Retrieving values from DataGrid row in edit mode.

M

Mark Davidson

Hi,

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

and

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

Any ideas would be much appreciated.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top