We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

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 09:18 AM

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.
Live Chat Icon For mobile
Up arrow icon