Button cell displays a button inside the cell.
You can use the ButtonCellType class in the GrapeCity.Wpf.SpreadSheet.CellType namespace to configure it. By default, it displays a rectangular-shaped button with gray color. This type of cell can display text and pictures on buttons. The Content property allows you to display text on the button, making it easy to label its purpose. To enable the display of custom data, such as images, you can use the ContentTemplate property.
Additionally, button cells support command execution, where clicking the button triggers a command. For this functionality, use the properties of the CellCommandParameter class, which contains details about the specific cell where the button was clicked. The available properties are listed in the table below.
Property | Description |
Column | Gets the column of the button that is clicked. |
Row | Gets the row of the button that is clicked. |
CustomCommandParameter | Gets or sets the parameters to pass to the command. |
Worksheet | Gets the worksheet of the button that is clicked. |
The following example code implements the process of deleting a row when the button is clicked as defined in the MyDeleteCommand class.