Accessing the textbox when user edits text in datagrid.

R

Rod

I want to be able to access the text in an edit text box which appears when
editting a row in a datagrid

Now I know that if you have a button column then you can do it like this.

Sub UpdateGridData(ByVal Sender As Object, ByVal E As
DataGridCommandEventArgs)

Dim objTextBox As TextBox

objTextBox = E.Item.FindControl("edit_title")

Dim strTitle As String = objTextBox.Text



However I want to use a single button which is not part of the datagrid.

I had hoped to do it like this

Private Sub btnUpdateSelectedRow_Click(........

Dim objTextBox As TextBox

objTextBox = myDataGrid.FindControl("edit_title")

but this just returns nothing

If it helps I know the datagrid's EditItemIndex as this has been put into a
viewstate

Any clues please.

PS. This system will only have a few users so efficiency is not a big
consideration.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top