GrapeCity MultiRow Windows Forms Documentation
Selecting Cells using Headers

Use the HeaderCell.SelectionMode property to select cells using headers. This property sets the area or range that is selected when the header is clicked. This property can be used in the ColumnHeaderCell, RowHeaderCell, or CornerHeaderCell sections which inherit from header cell.

If sorting using a header has been enabled for a header, you cannot select cells using this same header.

Select only Cells Inside the Header Area

You can specify that only cells within the header area are selected when the user clicks on the header if the HeaderCell.SelectionMode property has been set to ContainedCells.

The following image shows what happens when the user clicks on a column header, how the column header area is calculated, and how the cells are selected. Note that the cells lying partially inside the column header area are not the target for selection.

Selection of Cells that lie in the Header Area

The calculation for the header area uses the cell width for column headers and cell height for row headers.

Select All Cells in the Header Area

All the cells included in the header area are selected when the user clicks on a header if the HeaderCell.SelectionMode property has been set to IntersectedCells.

The following image shows what happens when the user clicks on a column header, how the column header area is calculated, and how the cells are selected. Note that the cells lying partially inside the column header area are also a target for selection.

Selection of all the Cells in the Header Area

The calculation of the header area uses the cell width for column headers and cell height for row headers.

Select Rows

The entire row is selected when the user clicks on the header if the HeaderCell.SelectionMode property has been set to Row. You cannot specify this value in the column header cell.

Select Rows using Row Headers

Select All Rows

All the rows in the grid are selected when the user clicks on the header if the HeaderCell.SelectionMode property has been set to AllRows. You cannot specify this value in the row header cell. The default value of the SelectionMode property in the corner header cell is AllRows.

Disable Selection

The cells are not selected if the user clicks on the header when the HeaderCell.SelectionMode property has been set to None. This setting can be used when you want to sort using the column headers, disable the selection operation, or any other customizations.

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options