T
tfsmag
Hello,
I'm still relatively new to asp.net and i'm having troubles with a
dropdownlist in a datagrid. Here is the code for the dropdownlist
---------------------------------
<aspropDownList Runat="server"
OnSelectedIndexChanged="ddlSelectionChanged" SelectedValue='<%#
DataBinder.Eval(Container.DataItem, "ACTIVE")%>' ID="DropDown"
AutoPostBack="True">
<asp:ListItem Value="1">Enabled</asp:ListItem>
<asp:ListItem Value="0">Disabled</asp:ListItem>
<asp:ListItem Value="2">Deleted</asp:ListItem>
</aspropDownList>
---------------------------------
This renders fine, and the proper index is selected when the page comes
up, the difficulty i'm having is capturing the row's unique id field to
update the database when they select a new index and fire the
"ddlSelectionChanged".
Here is the codebehind code for the ddlSelectionChanged event
---------------------------
Protected Sub ddlSelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DropDown.SelectedIndexChanged
Dim ddl As DropDownList
ddl = CType(sender, DropDownList)
Dim user_id as integer = (??? this is where i can't figure out
how to get the row id)
End Sub
---------------------------
The event does fire, I made sure of that by using a label and wrote
something to the label at the end of the event.
Any help here would be greatly appreciated as I am about ready to pull
my hair out!
Thanks,
Jeff T.
I'm still relatively new to asp.net and i'm having troubles with a
dropdownlist in a datagrid. Here is the code for the dropdownlist
---------------------------------
<aspropDownList Runat="server"
OnSelectedIndexChanged="ddlSelectionChanged" SelectedValue='<%#
DataBinder.Eval(Container.DataItem, "ACTIVE")%>' ID="DropDown"
AutoPostBack="True">
<asp:ListItem Value="1">Enabled</asp:ListItem>
<asp:ListItem Value="0">Disabled</asp:ListItem>
<asp:ListItem Value="2">Deleted</asp:ListItem>
</aspropDownList>
---------------------------------
This renders fine, and the proper index is selected when the page comes
up, the difficulty i'm having is capturing the row's unique id field to
update the database when they select a new index and fire the
"ddlSelectionChanged".
Here is the codebehind code for the ddlSelectionChanged event
---------------------------
Protected Sub ddlSelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DropDown.SelectedIndexChanged
Dim ddl As DropDownList
ddl = CType(sender, DropDownList)
Dim user_id as integer = (??? this is where i can't figure out
how to get the row id)
End Sub
---------------------------
The event does fire, I made sure of that by using a label and wrote
something to the label at the end of the event.
Any help here would be greatly appreciated as I am about ready to pull
my hair out!
Thanks,
Jeff T.