The System.Web.UI.WebControls GridViewUpdateEventArgs is a class in the System.Web assembly of the .NET Framework that provides data for the RowUpdating event of a GridView control. This class allows you to access the old and new values of a row being updated in a GridView control.
Example:
The following example demonstrates how to use GridViewUpdateEventArgs to update data in a GridView control:
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { // Get the values of the old and new data string oldName = e.OldValues["Name"].ToString(); string newName = e.NewValues["Name"].ToString();
// Update the data UpdateCustomer(oldName, newName);
// Cancel the edit mode GridView1.EditIndex = -1;
// Rebind the GridView control to display the updated data BindGridView(); }
In this example, when the RowUpdating event is raised, the old and new values of the row being updated are accessed through the OldValues and NewValues properties, respectively. The new data is then updated in the data source, and the GridView control is rebound to display the updated data.
Package Library:
System.Web.UI.WebControls is part of the System.Web assembly in the .NET Framework. Therefore, to use the GridViewUpdateEventArgs class, you need to reference the System.Web assembly in your project.
C# (CSharp) System.Web.UI.WebControls GridViewUpdateEventArgs - 60 examples found. These are the top rated real world C# (CSharp) examples of System.Web.UI.WebControls.GridViewUpdateEventArgs extracted from open source projects. You can rate examples to help us improve the quality of examples.