Retrieving values from DataGrid row in edit mode.

Discussion in 'ASP .Net' started by Mark Davidson, Aug 11, 2003.

  1. 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
    Mark Davidson, Aug 11, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    Highlighted Row in Edit,insert Mode(Datagrid) - Question -

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    680
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Nov 11, 2004
  2. Schultz
    Replies:
    3
    Views:
    557
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Feb 14, 2005
  3. Frank Kurka
    Replies:
    8
    Views:
    305
  4. greenb

    Retrieving values from DataGrid row before update

    greenb, Jul 5, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    123
    greenb
    Jul 5, 2005
  5. greenb
    Replies:
    1
    Views:
    123
    Michael Baltic
    Jul 6, 2005
Loading...

Share This Page