Accessing the textbox when user edits text in datagrid.

Discussion in 'ASP .Net' started by Rod, Mar 7, 2007.

  1. Rod

    Rod Guest

    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.
     
    Rod, Mar 7, 2007
    #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. Jim Heavey

    Datagrid Edits

    Jim Heavey, Nov 17, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    407
    Jim Heavey
    Nov 17, 2003
  2. Garry Dawkins

    Form edits

    Garry Dawkins, Dec 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    493
    Garry Dawkins
    Dec 8, 2003
  3. =?Utf-8?B?U2NvdHQgYXQgQ2VkYXIgQ3JlZWs=?=

    FormView doesn't store any edits

    =?Utf-8?B?U2NvdHQgYXQgQ2VkYXIgQ3JlZWs=?=, Feb 8, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,469
    Christopher Reed
    Feb 11, 2006
  4. JeffJones176

    DataGrid Edits

    JeffJones176, Jun 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    431
    JeffJones176
    Jun 7, 2006
  5. PaulNaude

    Datagrid: How do I allow edits but not new records?

    PaulNaude, Sep 19, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    128
    Brock Allen
    Sep 19, 2005
Loading...

Share This Page