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

Disabling Checkboxes in a GridGroup?

Hello, Is there any way in which I can query and change the enable/disabled status of a check box that is part of a datarow, being listed on a grouping grid? Thanks, David.

2 Replies

AD Administrator Syncfusion Team September 14, 2004 02:39 AM

You can use QueryCellStyleInfo to dynamcially set style properties on a cell. Here is a little snippet that disables the checkbox when the value of Col1 in the same row is no.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
	if(e.Style.CellType == "CheckBox")
	{
		GridRecordRow rec = this.gridGroupingControl1.Table.DisplayElements[e.TableCellIdentity.RowIndex] as GridRecordRow;
		if(rec != null)
		{
			DataRowView dr = rec.GetData() as DataRowView;
			if(dr != null && dr["Col1"].Equals("no"))
				e.Style.Enabled = false;
		}
	}
}


DL David Llewellyn September 14, 2004 05:32 PM

Hello. Just wanted to let you know that that code worked perfectly for that problem. Cheers again.

Loader.
Live Chat Icon For mobile
Up arrow icon