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 = "";
}
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 = "";
}