Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Saving gridview data on postback

Reply
Thread Tools

Saving gridview data on postback

 
 
vignesh86 vignesh86 is offline
Junior Member
Join Date: Jul 2010
Posts: 2
 
      07-21-2010
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 = "";

}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview - empty control data when saving? Knoxy ASP .Net 2 07-30-2008 03:38 PM
Saving a GridView control's data zoneal@yahoo.com ASP .Net 0 10-19-2006 01:23 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
Saving control postback data DKode ASP .Net 0 06-22-2005 03:31 AM
Data not saving during postback =?Utf-8?B?UGF1bCBL?= ASP .Net 2 08-16-2004 02:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57