G
Guest
Hi. I have an asp:ImageButton which appears when a datagrid row is placed in
Edit mode. The button has it's own click event which fires when the button
is clicked. Within the button's click event, I need to reference the
contents of a cell within the record currently in edit mode.
For example...
The datagrid has 3 columns: ID, Name, Picture
When placed in edit mode my asp:ImageButton appears in the Picture column,
and the ID and Name fields become editable. Within the sub that handles the
asp:ImageButton click event, I need to reference the contents of the Name
column.
I've tried...
Dim Name as String
Name = (CType(DataGrid1.Items.Cells(2).Controls(0), TextBox).Text)
Which does not work.
How can I accomplish this? Thanks!
Edit mode. The button has it's own click event which fires when the button
is clicked. Within the button's click event, I need to reference the
contents of a cell within the record currently in edit mode.
For example...
The datagrid has 3 columns: ID, Name, Picture
When placed in edit mode my asp:ImageButton appears in the Picture column,
and the ID and Name fields become editable. Within the sub that handles the
asp:ImageButton click event, I need to reference the contents of the Name
column.
I've tried...
Dim Name as String
Name = (CType(DataGrid1.Items.Cells(2).Controls(0), TextBox).Text)
Which does not work.
How can I accomplish this? Thanks!