The Kettic Data GridView Control for ASP.NET WebForms provides powerful data editing functionalities. GridView users can easily restrict user interaction and data modification as necessary through the properties. Furthermore, it is easy to perform cell editing or data entry for end users at any time they need to manipulate the data. It also offers a very nice interface for end users to edit or insert data via an editor based on data type. There are two ways to edit data items in the asp.net gridview control, one is using the editor to modify the data, the other is using command expression to edit the data items. In this tutorial article, we will introduce you how to define the editing command events in the web grid view using C# language.
Kettic GridView provides two different ways to add new rows into web data grid. One is to add new grid rows into the data source that has been bound to the asp.net GridView project. The other is to programmatically insert new rows to the Rows collection of GridView C# class.
While inserting a record, users always like to use the edit mode as InPlace or EditForms. And for a simplest way is using InsertCommand.
The following code is show you how to enable a insert button in the grid header and insert the input data to the web grid view.
While reading and viewing the asp.net datagrid, you maybe find something wrong in the data record showing up, or want to upgrade some data to make it close to truth. So you need to change some data item in the data source bound to the web gridview. In such case, you can set the gridview row to edit mode. Then the user can change the data in the edit fields, and after clicking the update button in the command template, all the data will be updated through the code below.
If you want to delete records in grid view, you can enable automatic delete operation through DeleteCommand. And in the DeleteCommand event, you can writing your own deleting steps in C# code.
Please note, all these editing operations are programmatically done using the C# code in the server side. After the editing coding, the asp.net gridview will postback the operation, and the grid view will redraw dynamically in the client side.
ASP.NET AJAX UI Controls