Basic Editing

 
ID
Ship name
Ship city
 
 
10248
Vins et alcools Chevalier
Reims
 
10249
Toms Spezialitäten
Münster
 
10250
Hanari Carnes
Rio de Janeiro
 
10251
Victuailles en stock
Lyon
 
10252
Suprêmes délices
Charleroi
 
10253
Hanari Carnes
Rio de Janeiro
 
10254
Chop-suey Chinese
Bern
 
10255
Richter Supermarkt
Genève
 
10256
Wellington Importadora
Resende
 
10257
HILARIÓN-Abastos
San Cristóbal

Edit Column Settings

The C1GridView supports server editing. This sample shows how to use custom data binding to bind the C1GridView to a dataset stored in the session object, how to use template fields to implement custom editors and how to use UpdateBindings collections of the template fields to automatically update the dataset with the Update method when custom data binding is used.

Server-side editing in C1GridView is row-based. At each moment only one data row determined by the EditIndex property is in edit mode.

The following techniques are used in this sample:

  • Template fields - to implement custom editors. The ItemTemplate and HeaderTemplate properties determine cell content for display and edit purposes.
  • Update bindings - links editor of the template columns with data field. This allows using the Update() method to automatically update the dataset when custom data binding is used.
  • C1CommandField column with the properties ShowEditButton and ShowDeleteButton. Adds Edit, Сancel, Update, and Delete buttons to each data row clicking which end-user edits data.

The following event handlers are used in this sample:

  • RowEditing - to put the C1GridView's row into the edit mode when the Edit button of the row is clicked.
  • RowCancelingEdit - to cancel editing when the Cancel button of the row is clicked.
  • RowUpdating - to handle changes, update the dataset and put the editing row into the normal mode when the Update button of the row is clicked.
  • RowDeleting - to delete the row when the Delete button of the row is clicked.