Change cells .Enabled property at runtime

Hi, I want to set a cells .Enabled property to false when a user clicks on a checkbox within a different cell. Thanks Iain

1 Reply

AD Administrator Syncfusion Team December 10, 2004 02:18 PM UTC

If this is a non-virtual GridControl, you can use the grid.CheckBoxClick event. In your handler, you can set the grid[row, col].Enabled = false for the cell you want to disable. If this is a GridDataBoundGrid (or a virtual GridControl), you cannot do this. Instead you should handle the grid.Model.QueryCellInfo event. In the handler, check e.RowIndex and e.ColIndex. If they point to a cell that you MAY want to disable, then get the value of the checkbox useing grid[e.RowIndex, checkBoxColIndex].CellValue. Then use this value to decide whether to set e.Style.Enabled = false for the cell that e.RowIndex and e.ColIndex point to.

Loader.
Up arrow icon