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 06:39 AM UTC

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 09:32 PM UTC

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

Loader.
Up arrow icon