Data Binding and Edit/Update/Cancel Chicken-and-Egg Problem

Discussion in 'ASP .Net Datagrid Control' started by dcouture@tycoint.com, Apr 6, 2005.

  1. Guest

    Would you be able to help me out on this one? I've got a DataGrid
    control that I create dynamically - no problem there. I also add a
    hyperlink column - again no problem. Now I'm adding the
    Edit/Update/Cancel column - Problem! The issue is that since the user
    may have done editing, I don't want to do a DataBind() when I'm
    reloading the page. However, I seem to need to do the DataBind() to get
    the hyperlink and Edit/Update/Cancel columns to redisplay. The only
    site that I found that had an answer to this question... required
    payment! Ugh! Any help you can give me would be greatly appreciated.
    Thanks.
     
    , Apr 6, 2005
    #1
    1. Advertising

  2. Elton Wang Guest

    Hi Dcouture,

    You can try following logic:

    if (postback){
    if (datagrid.EditItemIndex > -1){
    // get Edit Item
    item = datagrid.Items(datagrid.EditItemIndex);
    // process data in the item
    }
    }
    DataBind()

    HTH

    Elton Wang


    >-----Original Message-----
    >Would you be able to help me out on this one? I've got a

    DataGrid
    >control that I create dynamically - no problem there. I

    also add a
    >hyperlink column - again no problem. Now I'm adding the
    >Edit/Update/Cancel column - Problem! The issue is that

    since the user
    >may have done editing, I don't want to do a DataBind()

    when I'm
    >reloading the page. However, I seem to need to do the

    DataBind() to get
    >the hyperlink and Edit/Update/Cancel columns to

    redisplay. The only
    >site that I found that had an answer to this question...

    required
    >payment! Ugh! Any help you can give me would be greatly

    appreciated.
    >Thanks.
    >
    >.
    >
     
    Elton Wang, Apr 7, 2005
    #2
    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. Ralph Krausse

    Chicken or Egg, XML or XSD

    Ralph Krausse, Sep 2, 2004, in forum: XML
    Replies:
    3
    Views:
    506
  2. ASF
    Replies:
    3
    Views:
    278
    sloan
    Nov 3, 2006
  3. Catherine
    Replies:
    2
    Views:
    324
    John Nagle
    Oct 8, 2007
  4. R. Bernstein
    Replies:
    3
    Views:
    381
    R. Bernstein
    Dec 21, 2008
  5. Lew
    Replies:
    1
    Views:
    1,347
    Frank Cisco
    Feb 21, 2009
Loading...

Share This Page