Get datagrid textbox value

Discussion in 'Software' started by kanchangorak, Mar 11, 2009.

  1. kanchangorak

    kanchangorak

    Joined:
    Mar 10, 2009
    Messages:
    1
    I have bound datagrid with edit,update events. I am able to extract textbox values of datagrid in edit event but in the update event, its returning null textbox value. I want to get the value of textbox that is dynamically generated by the datagrid in update event.

    TextBox txtbox = new TextBox();
    txtbox = (TextBox)e.Item.FindControl(e.Item.Cells[1].Controls[0].ID);

    the above code returns null value for txtbox.Text.

    I also tried extracting vaues using these lines of code, but still returns null

    TextBox txtbox = new TextBox();
    txtbox = (TextBox)e.Item.Cells[1].Controls[0];
    string lastname = txtbox.text
     
    kanchangorak, Mar 11, 2009
    #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. smi59550
    Replies:
    0
    Views:
    1,557
    smi59550
    Jan 18, 2008
  2. smi59550
    Replies:
    0
    Views:
    6,117
    smi59550
    Jan 18, 2008
  3. gautam2u@gmail.com
    Replies:
    2
    Views:
    1,642
    ProgTalk
    Feb 7, 2008
  4. susan_1516

    validating textbox inside datagrid

    susan_1516, Nov 9, 2008, in forum: Software
    Replies:
    0
    Views:
    1,214
    susan_1516
    Nov 9, 2008
  5. arecev
    Replies:
    0
    Views:
    1,525
    arecev
    Apr 5, 2009
Loading...

Share This Page