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.

Adding Checkbox in summary cells

Thread ID:

Created:

Updated:

Platform:

Replies:

56808 Feb 21,2007 06:15 AM Feb 21,2007 01:00 PM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 21, 2007 06:15 AM

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

Administrator [Syncfusion]
Replied On February 21, 2007 01:00 PM

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

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.

;