You can add the unbound CheckBox columns to the GridGroupingControl by using the TableDescriptor.UnboundFields.Add() method. This method allows you to add the unbound fields to the GridGroupingControl. Unbound values can be provided in QueryValue event and any changes in the values can be stored back to the data store by handling the SaveValue event. Additionally, you can handle QueryCellStyleInfo event to customize unbound cells individually.
You can save the values elsewhere as the grouping grid does not maintain any data structure to store cell values. Since the values are unbound, they cannot be stored into bound data source too. In this example, a HashTable is used to save the values of unbound column. The example displays an unbound CheckBox column along with other bound columns. Refer to the following steps to have an unbound checkbox column in the GridGroupingControl.
1. Adding an unbound column
2. Creating Hashtable to store unbound column values.
3. Declaration of the events
Then QueryValue event is used to edit the values in the checkbox. The SaveValue event is used to save the changes that you made in the checkbox.
The following screenshot illustrates the output.
Figure 1: Adding unbound CheckBox column in GridGroupingControl
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|