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.

How do I put a CheckBox in a header cell in the GridControl or the GridDataBoundGrid?

GridControl:

To put a CheckBox in the GridControl, set the CellType to CheckBox and assign string values for the CheckedValue and UncheckedValue in the CheckBoxOptions property. The value of the CheckBox can be stored to a particular cell in the GridControl and the CheckBoxClick event gets triggered when the CheckBox is clicked.

 

The following is the code example for GridControl.

C#

 

VB

 

GridDataBoundGrid:

To put a CheckBox in the GridDataBoundGrid, two events have to be used. The QueryCellInfo event is used to set the style properties and the SaveCellInfo event is used to save the cell's value. The value of the CheckBox cannot be stored in the GridDataBoundGrid, so any datatype/collection can be used to store the value. The CheckBoxClick event gets triggered when the CheckBox is clicked.

 

In the following code example, the CheckBox is added to the Column header on the GridDataBoundGrid.

C#

 

VB

 

In the following screenshot, the CheckBox is added to the Column header on the GridControl and GridDataBoundGrid.

Figure 1: CheckBox in the Header for GridControl and GridDataBoundGrid

Sample Link

C#: CheckBox HeaderCell CS

VB: CheckBox HeaderCell VB

Article ID: Published Date: Last Revised Date: Platform: Control:
3954 02/12/2015 02/08/2017 Windows Forms GridDataBoundGrid(Classic)
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.