The new version of these examples uses a completely different approach to implement the required feature. When a cell is modified, a custom callback is sent via component ASPxCallback and the grid data source is updated manually. The drawback of such an approach is that the ASPxGridView editing API is not used here and you have to implement custom functions to update the data source directly. On the other hand, this approach works much more smooth and fast and provides more pleasant user experience.
The steps to implement are:
2. Handle the ASPxClientGridView.BatchEditEndEditing, ASPxCallback.Callback and ASPxClientCallback.CallbackComplete events;
3. In the BatchEditEndEditing event handler, collect the information about the edited row and send the information to the server side. Use the ASPxClientCallback.PerformCallback method for this.
4. In the Callback event handler, update the data source with the new data and return the result string (OK or the error message);
5. Use the CallbackComplete event handler to return the focus to the last edited cell if something went wrong. For example, a server-side validation error.
Description for versions prior 16.2
By default, the ASPxGridView allows an end-user to edit a whole row in the ASPxGridView. The sample project attached to this example shows how to edit a clicked cell only.
Here are the necessary steps:
1) Create a new class supporting the ITemplate interface. Its instance will be used inside the EditItemTemplate Container of all the columns except for the clicked one;
2) Handle the ASPxGridView's server side HtmlDataCellPrepared event to subscribe to the cell's client side onclick event;
3) Determine the clicked cell and send a callback to the server in this event handler;
4) Handle the ASPxGridView's CustomCallback event handler to set the columns' EditItemTemplate property;
5) Handle the Page_Load method and restore templates set within the CustomCallback event handler;
6) A hidden input is used on this page to eliminate a known IE issue when a postback is automatically sent to the server when the Enter key is pressed and a single visible INPUT element is on the page.
How to implement a single cell editing feature in ASPxGridView for iOS devices
How to implement a single cell editing feature in GridView