By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,172 Members | 1,751 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,172 IT Pros & Developers. It's quick & easy.

Reference Datagrid cell contents

P: n/a
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!
Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.