Jump to content
  • Advertisement
Sign in to follow this  
coolblue

[.net] get updated gridview values

This topic is 4487 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
The updating event is passed an GridViewUpdateEventArgs, which contains the new and old values.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!