Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > Get datagrid textbox value

Thread Tools

Get datagrid textbox value

kanchangorak kanchangorak is offline
Junior Member
Join Date: Mar 2009
Posts: 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
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
Pass value from activex textbox to webform textbox AGSHAR ASP .Net 1 05-31-2008 12:00 PM
get Textbox Value in datagrid using JavaScript rockdale ASP .Net 2 06-06-2006 06:00 PM
ASP.NET textbox loses text value in composite control but Textbox subclass doesn't!? ErwinP ASP .Net Web Controls 1 08-19-2005 01:50 PM
Get textbox value from datagrid problem Steve F. ASP .Net Datagrid Control 1 09-15-2004 10:20 AM
Unable to get textbox value from datagrid that is in UserControl moid ASP .Net 1 01-27-2004 02:58 PM