Disabling a checkbox cell in GDBG

Hi How can I disable a specific cell that shows a check box in GDBG. For example I want to bind a GDBG to a table that has two Boolean columns B1 and B2. I want that in a specific rowX I will have the next rule: The cell of rowX.B2 is enabled if the value of rowX.B1 is true. 10x Asaf

1 Reply

AD Administrator Syncfusion Team October 26, 2004 05:21 AM UTC

You can subscribe to the grid.Model.QueryCellInfo event. In your handler, try code like below to disable the B2 cell when B1 is false.
if(e.ColIndex > 0 && e.RowIndex > 0)
{
	int col = this.grid.Binder.NameToColIndex("B2");
	if(col == e.ColIndex)
	{
		col = this.grid.Binder.NameToColIndex("B1");
		object o = this.grid[e.RowIndex, col].CellValue;
		if(o != null && !(bool)o)
		{
			e.Style.Enabled = false;
		}
	}
}

Loader.
Up arrow icon