[.net] get updated gridview values
I have a gridview with an object array as its datasource. When I click on update the RowUpdating event fires fine. In the RowUpdating event, I need to get the new value but everything shows the old value, how do I get the updated value? please also note that the gridview is being built programatically as shown below.
protected void PopulateFileGrid()
{
grdDocuments.Columns.Clear();
grdDocuments.DataSource = _article.DocumentArr;
grdDocuments.AutoGenerateColumns = false;
BoundField bndf = new BoundField();
bndf.DataField = "DocClientFilePath";
bndf.HeaderText = "File Name";
bndf.ReadOnly = true;
grdDocuments.Columns.Add(bndf);
BoundField bndf2 = new BoundField();
bndf2.DataField = "DocName";
bndf2.HeaderText = "Title";
grdDocuments.Columns.Add(bndf2);
grdDocuments.EnableViewState = true;
string[] dd = new string[1];
dd[0] = "DocID";
grdDocuments.DataKeyNames = dd;
grdDocuments.AutoGenerateEditButton = true;
grdDocuments.DataBind();
}
The updating event is passed an GridViewUpdateEventArgs, which contains the new and old values.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement