sarang8180
asked on
Gridview UpdateProblem
How to Update the values in gridview if it shows old values....
FillData();
GridViewRow gr1 = (GridViewRow)dgrData.Rows[ e.RowIndex ];
TextBox tCategory=(TextBox)gr1.Fin dControl(" txtCategor y");
//DataBind();
string update = "update category set category='" + tCategory.Text + "' where cat_id=" + dgrData.DataKeys[e.RowInde x].Values[ 0].ToStrin g() + "";
FillData();
GridViewRow gr1 = (GridViewRow)dgrData.Rows[
TextBox tCategory=(TextBox)gr1.Fin
//DataBind();
string update = "update category set category='" + tCategory.Text + "' where cat_id=" + dgrData.DataKeys[e.RowInde
ASKER
if i call the data from database again and bind to gridview,it shows old data in textbox of gridview.
If i don't call,keep it in !IsPostBack.Then Gridview vanishes on click of update link
If i don't call,keep it in !IsPostBack.Then Gridview vanishes on click of update link
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Call the Load Grid function again,that means
1) Get the data from the DB
2) the List/Dataset/Datatable assign to Grid.Datasource
3) call Grid.Databind() again
-- Deepu