Sign in to follow this  
coolblue

[.net] get updated gridview values

Recommended Posts

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(); }

Share this post


Link to post
Share on other sites
The updating event is passed an GridViewUpdateEventArgs, which contains the new and old values.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this