Hi Stefano,
Thanks for contacting Syncfusion support.
Your requirement is achieved by using the rowSelecting event in Grid which triggers before a row is selected.
Please refer to the Help document and code example as follows,
Document: http://help.syncfusion.com/js/api/ejgrid#events:rowselecting
Sample: http://jsplayground.syncfusion.com/x23vxig3
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
allowPaging: true,
enableRowHover: false,
. . .
rowSelecting: function (args) {
var indexes = [0, 2, 4, 11]; // row indexes to be unselectable
if ($.inArray(args.rowIndex, indexes) != -1)
args.cancel = true; //prevent selection
}
});
|
In above code example, we have prevented the row selection by setting the args.cancel as true to the row indexes 0, 2,4,11. So you can specify the indexes that are needs to be unselected in rowSelecting event.
Regards,
Balaji Marimuthu