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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I place a CheckBox in a header cell of the GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 30, 2011 |
Last Revised Date: September 25, 2018

A CheckBox can be placed in a header cell of the GridGroupingControl by handling the QueryCellStyleInfo event.

 

C#

VB

 

By default, the selected cell’s MouseController calls the Cellrenderer’s MouseUp that in turn raises the CheckBoxClick. The DragGroupHeader MouseController for the header cells does not call the Renderer’s MouseUp. So you have to explicitly call the Renderer’s Mouseup from the TableControl’s Mouseup checking for the MouseController type.

 

C#

VB

 

By default, when the header is clicked, the sorting operation is done in the columns. To avoid this, the sorting is disabled in the header by providing the following code.

 

C#

 

VB

 

The value of the CheckBox can be received through the SaveCellText handler that saves the value from the Grid. In the given sample, a temporary variable (CheckBoxValue) has been used to keep the modified value of the CheckBox and this value is refreshed through the QueryCellStyleInfo event.

 

C#

 

VB

 

When the CheckBox is clicked, it enables/disables all the check boxes in the column except the header cell.

 

C#

 

VB

After applying the properties, the Grid is shown as follows,

Figure 1: Enabling the CheckBoxes in the column

Sample Links

CS: CheckBox_in_header

VB: CheckBox_in_header

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon