Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] get updated gridview values

Started by coolblue Apr 3, 2006 at 9:37 AM 1 replies 750+ views
Original Post
coolblue
coolblue
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(); }
Washu
Washu
The updating event is passed an GridViewUpdateEventArgs, which contains the new and old values.
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
coolblue
coolblue
Both the old and new values have a count of 0.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.