S
steve roszko
I have a dropdownlist in a column of my datagrid. When
the user
changes the value in the ddl, I want to fire off
OnSelectedIndexChange
event and do an update based on the id held in a hidden
column of the
grid. But I cannot seem to get to that cell info from my
OnSelectedIndexChange procedure.
Here is some of the code:
[DATA GRID SETUP]
<Columns>
<asp:BoundColumn Visible=false ReadOnly=True
DataField="projDetailID"
HeaderText="ID" />
<asp:TemplateColumn headertext="% Complete"
SortExpression="PercentComplete" >
<ItemTemplate>
<aspropDownList id="ddlPercentComplete" runat="server"
AutoPostBack=True
OnPreRender="SetPercentIndex"
OnSelectedIndexChanged="RecordPercentDone"</aspropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</columns>
Public Sub RecordPercentDone(ByVal sender As Object, ByVal
e As
System.EventArgs)
'this is where I am trying to get the ID value of the row
'that the ddl index was changed
'once I get the ID, I can then write the real code for
the update
Dim ed As DropDownList = CType(sender, DropDownList)
Dim mylbl As Label = CType(ed.Parent.Parent.FindControl
("ID"),
Label)
Me.lblOutput.Text += mylbl.Text & "<BR>"
Dim dg As DataGrid = CType(ed.Parent.Parent, DataGrid)
Me.lblOutput.Text += mycell.Text & "<BR>"
Me.lblOutput.Text += dg.Items.Item(0).Cells
(0).Text.ToString() &
"<BR>"
Me.lblOutput.Text += ed.Parent.GetType.ToString & "<BR>"
End Sub
Thanks!!
Steve
the user
changes the value in the ddl, I want to fire off
OnSelectedIndexChange
event and do an update based on the id held in a hidden
column of the
grid. But I cannot seem to get to that cell info from my
OnSelectedIndexChange procedure.
Here is some of the code:
[DATA GRID SETUP]
<Columns>
<asp:BoundColumn Visible=false ReadOnly=True
DataField="projDetailID"
HeaderText="ID" />
<asp:TemplateColumn headertext="% Complete"
SortExpression="PercentComplete" >
<ItemTemplate>
<aspropDownList id="ddlPercentComplete" runat="server"
AutoPostBack=True
OnPreRender="SetPercentIndex"
OnSelectedIndexChanged="RecordPercentDone"</aspropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</columns>
Public Sub RecordPercentDone(ByVal sender As Object, ByVal
e As
System.EventArgs)
'this is where I am trying to get the ID value of the row
'that the ddl index was changed
'once I get the ID, I can then write the real code for
the update
Dim ed As DropDownList = CType(sender, DropDownList)
Dim mylbl As Label = CType(ed.Parent.Parent.FindControl
("ID"),
Label)
Me.lblOutput.Text += mylbl.Text & "<BR>"
Dim dg As DataGrid = CType(ed.Parent.Parent, DataGrid)
Me.lblOutput.Text += mycell.Text & "<BR>"
Me.lblOutput.Text += dg.Items.Item(0).Cells
(0).Text.ToString() &
"<BR>"
Me.lblOutput.Text += ed.Parent.GetType.ToString & "<BR>"
End Sub
Thanks!!
Steve