Assuming you are using templates for the check box column and the checkbox is the only control in that template, something like the following can be used for your scenario.
确定你用的是templates 的checkbox行,并且该模板中只有checkbox一个空间。
Handle the EnteringEditMode event off of the CellEditing behavior.添加一个EnteringEditMode 事件
<ig:EditingCore> <Behaviors> <ig:CellEditing> <CellEditingClientEventsEnteringEditMode="enteringEditMode" /> </ig:CellEditing> </Behaviors> </ig:EditingCore>
The event handler may look like this:事件函数如下:
function enteringEditMode(grid, eventArgs) { var cell = eventArgs.getCell(); if (cell.get_column().get_key() == "SecondColumn") { checkboxCell = cell.get_row().get_cellByColumnKey("FirstColumn"); if (!checkboxCell.get_element().firstChild.checked) eventArgs.set_cancel(true); } }