Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

ASPxGridView - Batch Edit mode - How to use the client-side FocusedCellChanging event and cancel/disable editing an editor or row conditionally

$
0
0
Starting from version 17.1 we have introduced a new client-side FocusedCellChanging event. This event allows you to skip focusing and editing a cell.
This example demonstrates different ways to skip or prevent editing certain cells.
The main idea is to get the currently focused cell using the ASPxClientGridViewFocusedCellChangingEventArgs.cellInfo property and decide whether it is required to skip focusing or not:
[JavaScript]
function onFocusedCellChanging(s, e){if(e.cellInfo.column.name == 'command') e.cancel = true;elseif(e.cellInfo.column.fieldName == 'SupplierID') e.cancel = true;elseif(e.cellInfo.column.fieldName == 'UnitsInStock'&& (e.cellInfo.rowVisibleIndex < 3 || e.cellInfo.rowVisibleIndex > 7)) e.cancel = true;elseif(e.cellInfo.column.fieldName == 'UnitPrice'&& s.batchEditApi.GetCellValue(e.cellInfo.rowVisibleIndex, 'UnitPrice')> 22) e.cancel = true;}

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>