Ask a Question related to ASP.NET General, Design and Development.
-
steve roszko #1
Get value from datagrid DDL cell OnSelectedIndexChange
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>
<asp:DropDownList id="ddlPercentComplete" runat="server"
AutoPostBack=True
OnPreRender="SetPercentIndex"
OnSelectedIndexChanged="RecordPercentDone"</asp:DropDownList>>
</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
steve roszko Guest
-
DataGrid: How do I select and copy text for a DataGrid cell?
Hi, Do you know how do I select and copy txt from a cell inside a Flex 2 DataGrid? I don't want to use an itemRenderer. I will appreciate... -
DataGrid cell editing
I have set my DataGrid as editable and some column editable and others not. For some reason some cells blank out when I edit the cell contents... -
How to set cell background based on cell value when datagrid is displayed
I would like to check a datagrid cell value, and change the color of the cell background, when a datagrid is displayed. I want to do this as early... -
RadioButtonList In A DataGrid Cell - Can I find the selected button without editing the cell?
I have an ASP.NET form with a DataGrid and Button. I want to put a RadioButtonList in a DataGrid cell. I bind it to an ArrayList which has a... -
Get value from datagrid cell OnSelectedIndexChange
I figured out the solution: Public Sub RecordPercentDone(ByVal sender As Object, ByVal e As System.EventArgs) Dim ed As DropDownList =...



Reply With Quote

