Hi Swanand,
I find it important to mention that in a scenario where the RadGrid performs frequent PostBack requests to the server and when it comes to autosaving on cell change, we recommend using the InPlace editing mode, find more information on when Batch editing is suitable/not suitable for use in the RadGrid Batch Editing Templates and Specifics article.
However, If you have implemented a logic that works as desired when Ajax is disabled, It should work fine on a properly Ajaxified RadGrid also.
You should have in mind that AJAX may sometimes hide both server and client-side errors, we highly recommend while developing the application, to ensure that the functionality works without adding AJAX.
Therefore, please temporarily disable any AJAX on the page (if present) and use the Browser's DevTools Console to see whether there are any script or server errors interfering, and make sure that the application works without AJAX, see Get more descriptive errors by disabling AJAX
Below is a sample code for achieving behavior similar to the desired declaratively (the same structure can be created programmatically).
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function batchEditClosed(sender, args) {
var batchManager = sender.get_batchEditingManager();
var masterTable = sender.get_masterTableView();
setTimeout(function () {
if (batchManager.hasChanges(masterTable)) {
batchManager.saveChanges(masterTable);
}
}, 0);
}
</script>
</telerik:RadScriptBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="RadGrid1" runat="server">
<ClientSettings>
<ClientEvents OnBatchEditClosed="batchEditClosed" />
</ClientSettings>
<MasterTableView DataKeyNames="OrderID" EditMode="Batch" DataSourceID="SqlDataSource1">
You may also find useful to check out the Batch Editing Client-side API
I hope this will prove helpful!
Kind regards,
Doncho
Progress Telerik
Progress is here for your business, like always.
Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.