Checkbox cell adds a checkbox to the cell, allowing users to toggle options.
To create a checkbox in a cell, use the CheckBoxCellType class in the GrapeCity.Wpf.SpreadSheet.CellType namespace. Use Content property to display text in a checkbox. Additionally, the TrueContent, FalseContent, and IndeterminateContent properties allows you to customize text based on the checkbox state. If you want to display all three states; checked, unchecked, and Indeterminate, set the IsThreeState property to True.
Similar to Button cells, checkbox cells support command execution, where clicking the checkbox triggers a command. For this functionality, use the properties of the CellCommandParameter class. The available properties are listed in the table below.
Property | Description |
Column | Gets the column of the checkbox that is clicked. |
Row | Gets the row of the checkbox that is clicked. |
CustomCommandParameter | Gets or sets the parameters to pass to the command. |
Worksheet | Gets the worksheet of the checkbox that is clicked. |
Refer to the following example code to set data template with the IsThreeState property.