Edit on Template Column

Discussion in 'ASP .Net Datagrid Control' started by randy, Jun 28, 2004.

  1. randy

    randy Guest

    I have a datagrid with a Edit, Update, Cancel column. I clicked the
    "Convert this column into a Template Column" so I can mimic the below
    example and put a link button in the footer template area.

    http://www.dotnetbips.com/displayarticle.aspx?id=125

    The problem is, I need to click "edit" twice for the Edit Template textboxes
    to show (or refresh the page). I put my code in the DataGrid1_ItemCommand()
    event like so...

    If e.commandname.toupper = "EDIT" Then
    datagrid.EditItemIndex = e.item.itemindex
    End if

    If I rebind the datagrid after setting the EditItemIndex property The edit
    textboxes come up the first time but they are blank. There IS data in my
    source.

    If e.commandname.toupper = "EDIT" Then
    datagrid.EditItemIndex = e.item.itemindex

    datagrid1.datasource = datatable
    datagrid1.databind
    End if

    I want to note that the rest of my columns are template columns so I can
    have the "Add New" textboxes just like the example at that website.

    Much thanks,

    -Randy
    randy, Jun 28, 2004
    #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. Dexter
    Replies:
    1
    Views:
    408
    Eliyahu Goldin
    Jan 18, 2005
  2. keithb
    Replies:
    2
    Views:
    28,886
    keithb
    Jun 2, 2006
  3. AMT2K5
    Replies:
    0
    Views:
    353
    AMT2K5
    Mar 6, 2007
  4. Wenceslao Leon

    ImageButton in template column in edit mode don't fire event

    Wenceslao Leon, Sep 13, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    126
    Wenceslao Leon
    Sep 13, 2003
  5. keal75

    Calendar within DataGrid Edit Control or Template Column

    keal75, Nov 10, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    143
    keal75
    Nov 10, 2005
Loading...

Share This Page