Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Retrieving values from DataGrid row in edit mode.

Thread Tools

Retrieving values from DataGrid row in edit mode.

Mark Davidson
Posts: n/a

I have a datagrid with template columns. Everything is OK except that when I put any of the row in edit mode and try to retrieve the new values, I get the old values instead of the new ones. The line of code in UpdateCommand handler of the grid is:

strUserID = CType(e.Item.FindControl("txtUserID"), TextBox).Text

I also tried the following but no luck:

strUserID = CType(e.Item.Cells(2).FindControl("txtUserID"), TextBox).Text


strUserID = CType(e.Item.Cells(2).Controls(0), TextBox).Text

Any ideas would be much appreciated.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving values from DataGrid row before they are changed greenb ASP .Net Web Controls 1 07-06-2005 01:33 PM
Retrieving values from DataGrid row before update greenb ASP .Net Datagrid Control 0 07-05-2005 10:23 PM
Snapshot restraint - edit, edit, edit Alan Browne Digital Photography 24 05-10-2005 10:15 PM
Edit All Function for DataGrid, and Moving the Edit Function in a DataGrid Schultz ASP .Net 3 02-14-2005 04:47 AM
How to add a new row to a datagrid with values of the selected row =?Utf-8?B?U3VyZXNo?= ASP .Net 1 11-22-2004 09:04 AM