Saving gridview data on postback

Discussion in '.NET' started by vignesh86, Jul 21, 2010.

  1. vignesh86

    vignesh86

    Joined:
    Jul 17, 2010
    Messages:
    2
    Hi,

    In my application, I have a gridview which is visible with a blank row on Page_Load. The GV has 4 columns of which the first column is an editable textbox. The rest 3 are bound fields. When I enter a valid ID in the textbox cell and hit the Enter key(TextChanged Event), the rest of the 3 fields are bound and a new empty row is created below this row. But my problem is , when I enter the second data and hit Enter, the first row is lost and is replaced with this second row( Datatable not holding values on Postback). Kindly help...!!!



    protected void TextBox1_TextChanged(object sender, EventArgs e)

    {
    if (ID valid and data returned)

    {
    Addnewemptyrow; //For next input
    Bind data to current row;
    }
    if(Invalid ID and data not returned)
    {
    Cells[1].Text = ""; // Clear the current row values(Make it as a new row)
    Cells[2].Text = "";
    Cells[3].Text = "";

    }
     
    vignesh86, Jul 21, 2010
    #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. =?Utf-8?B?UGF1bCBL?=

    Data not saving during postback

    =?Utf-8?B?UGF1bCBL?=, Aug 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    646
    =?Utf-8?B?UGF1bCBL?=
    Aug 16, 2004
  2. John Kandell
    Replies:
    4
    Views:
    4,182
    eeebop
    Dec 10, 2004
  3. Luis Esteban Valencia
    Replies:
    0
    Views:
    2,533
    Luis Esteban Valencia
    Jan 6, 2005
  4. DKode

    Saving control postback data

    DKode, Jun 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    571
    DKode
    Jun 22, 2005
  5. Lovely Angel For You

    Saving Images While Saving ASP Pages !

    Lovely Angel For You, Oct 2, 2003, in forum: ASP General
    Replies:
    1
    Views:
    220
    Curt_C [MVP]
    Oct 3, 2003
Loading...

Share This Page