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.
Unfortunately, activation email could not send to your email. Please try again.

Disabling a checkbox cell in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

20791 Oct 25,2004 10:01 PM Oct 26,2004 01:21 AM Windows Forms 1
loading
Tags: GridControl
Asaf Segal
Asked On October 25, 2004 10:01 PM

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

Administrator [Syncfusion]
Replied On October 26, 2004 01:21 AM

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;
		}
	}
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;