GridDataControl allows you to load DataTemplate in the HeaderCell. You can load the DataTemplate in HeaderCell of GridDataControl by using HeaderCellTemplate property present in the GridDataControl’s VisibleColumns. You can load any control(s) within the DataTemplate.
The following code sample demonstrates how CheckBox is loaded inside HeaderCellsControl using DataTemplate.
GridDataControl allows you to control the behavior of the checkBox column. Here the behavior of what should be done when clicking on the checkBox in the header cell is written using the click event of the checkBox in the CheckBoxClickBehavior class. The following code example illustrates how the checkBox column is designed to behave when clicked.
In this example when the checkBox loaded inside the header cell is checked, then all the rows in that column will be automatically checked and vice versa. Whereas when you uncheck some of the rows in the IsChecked column by editing them, the checkBox in the header cell will go to intermediate state. This is achieved by handling the CurrentCellChanged event in GridDataControl. The following code sample shows how the state of the checkBox in the header cell is changed by handling the CurrentCellChanged event.
The following screenshot shows the output for the above code in GridDataControl.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:||Product Version:|