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
close icon

Adding Checkbox in summary cells

Hi

How to add Check box column in grid grouping control..? I want checkbox should come in detail as well as in all summary rows.
Please help

Thanks
Harshad

1 Reply

AD Administrator Syncfusion Team February 21, 2007 06:00 PM UTC

Hi Harshad,

Issue 1: How to add Check box column in grid grouping control?

You can use the GridColumnDescriptor to set the celltype of the column to checkbox. Here is a code snippet.

this.grid.TableDescriptor.Columns[0].Appearance.CellType = "CheckBox";

Issue 2: I want checkbox should come in detail as well as in all summary rows.

If you want to set the cell type of the summary cell to CheckBox, you need to handle the QueryCellStyleInfo event of the grid and set the e.Style.CellType to CheckBox. Please refer to the attached sample for implementation and let me know if this helps.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if( e.TableCellIdentity.ColIndex == 3
&& e.TableCellIdentity.TableCellType == GridTableCellType.SummaryEmptyCell )
{
e.Style.CellType = "CheckBox";
e.Style.HorizontalAlignment = GridHorizontalAlignment.Center;
e.Style.CheckBoxOptions.UncheckedValue = "0";
e.Style.CheckBoxOptions.CheckedValue = "1";
e.Style.Enabled = true;
e.Style.Clickable = true;
if( SummaryCells.Contains(e.TableCellIdentity.RowIndex ))
{
e.Style.CellValue = SummaryCells[e.TableCellIdentity.RowIndex] .ToString();
}
}
}

Sample : GGC_SummaryRowExportModified.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon