Problem with custom control

  • Thread starter Thread starter zoneal
  • Start date Start date
Z

zoneal

I am working on an application that displays a grid with dropdownboxs
in various parts of this grid. Now the entire gird is generated
dynamically based on user interaction, so i have put the code required
to generate this grid in an .ascx file. Here is my problem:

My grid is generating perfectly, but I am stuck on this on part: I
currently have the functionality that is the user changes an item in
any of the dropdowns, the form will postback to itself, however, i am
unable to get the selectedIndex.Text or Value.

first let me share with you how i create the drop downboxes:


hwriter.WriteBeginTag("select")hwriter.WriteAttribute("name",
i.ToString)hwriter.WriteAttribute("OnChange", " " &
Page.GetPostBackEventReference(Me,
Me.UniqueID))hwriter.Write(HtmlTextWriter.TagRightChar)hwriter.WriteBeginTag("option")hwriter.WriteAttribute("value",
"ins~" & intUsers(i).ToString & "~" & intLinkId.ToString & "~" &
dt.Rows(x).Item("roleValue"))hwriter.WriteAttribute("selected",
"selected")hwriter.Write(HtmlTextWriter.TagRightChar)hwriter.Write(dt.Rows(x).Item("name"))hwriter.WriteEndTag("option")

The way the above code is laid out, when a postback occurs, my
eventArgs is the value of: 'Me.UniqueID' which does me no good. I have
looked through my VS.Net help files and there are examples on how to do
this with button and raising the click event, I can not duplicate this
for the onChange event??? Any help as to how I can get the values of
the selected item would be greatly appreciated
 
zoneal,

I have some sample code on my website that shows how to add a checkbox to a
datagrid and then find which checkbox was checked via the checkboxes
autopostback. While the code isn't quite what you're trying to do the
process will be very similar.

If you'd like to take a look at the sample code to see if it leads you in
the right directio go to: http://www.aboutfortunate.com?page=codelibrary and
then use the search box there to search for: "datagrid checkbox".

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Back
Top