New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Batch Editing Overview

Batch Editing functionality of RadGrid enables inline client-side editing and performing multiple changes before the user decides to either apply the changes or cancel them. The feature is well integrated with existing RadGrid functionalities like automatic data source operations, hierarchy, selection, validation, template columns and event handling.

The feature could be easily enabled by setting the GridTableView.EditMode property to Batch. Additional properties for configuring the behavior of the functionality can be found in the GridTableView.BatchEditingSettings collection. You can find more details and examples in the Configuration article.

ASP.NET
<telerik:RadGrid RenderMode="Lightweight" runat="server" ID="RadGrid1">

	<MasterTableView CommandItemDisplay="Top" DataKeyNames="ID" EditMode="Batch">
	   <BatchEditingSettings />
       
       <Columns>
	       . . .
        </Columns>
	</MasterTableView>
</telerik:RadGrid>

If you want to implement your own CRUD operations instead of using declarative data sources, see the Batch Editing Server-side API article. It also shows how to access and modify the column editor properties on the server.

Once a postback to the server has been initiated, the user input cannot be restored in the browser. This can result in loss of data. To minimize this, use client-side validation and cancel the OnUserAction or OnCommand event in case the batch editing manager hasChanges() on the client.

Custom logic with the batch edit mode is usually written in JavaScript, however, and to this end you can use:

  • The Batch Edit Manager API that lets you get/set cell values and open/close cells.

  • The OnBatchEditOpened event that lets you modify cell values and controls insides based on other conditions and cell values.

  • The OnBatchEditOpening event that lets you prevent cells from being opened based on conditions, must like in the OnBatchEditOpened event.

  • OnBatchEditCellValueChanging and OnBatchEditCellValueChanged to get notified of and/or cancel changes to cell values.

  • OnBatchEditClosing and OnBatchEditClosed to get notified and prevent cells from closing.

  • Other events showcased in the Working with templates article that you can use for complex templates, objects and logic.

    Keep in mind that such custom logic must be entirely client-side and that the built-in batch editing cannot guarantee it will not cause errors. A few example of scenarios that are not supported are load-on-demand, complex control hierarchy (e.g., having several controls in the template), or any server operations.

See Also

In this article
See Also
Not finding the help you need?
Contact Support