[]
Alternating rows improve FlexGrid readability by applying different visual styles to alternating data rows. This styling helps distinguish adjacent rows and improves navigation in wide or dense datasets.
The feature supports configurable alternation logic, customizable appearance settings, and integration with detail rows.
The AlternatingStrategy property determines how alternating rows are calculated.
Strategy | Behavior | Recommended Usage |
|---|---|---|
Alternation is applied based on the current row order. Sorting or filtering the data can change the row order and, therefore, the alternating row pattern. | Standard tabular layouts and dynamic sorting/filtering scenarios | |
Alternation is based on the underlying data-source index. Striping remains consistent relative to the source data. | Master-detail layouts and detail row scenarios |
The AlternatingRows property specifies whether alternating styling is applied to even or odd rows.
Value | Description |
|---|---|
| Applies alternating styling to even rows |
| Applies alternating styling to odd rows |
This setting allows striping direction to be reversed without changing the assigned styles.
Example:
grid.AlternatingRows = GridAlternatingRows.Odd;
Alternating row appearance is configured through dedicated styling properties.
Property | Description |
|---|---|
Background color for alternating rows | |
Text color for alternating rows | |
Background color for alternating row headers | |
Text color for alternating row headers | |
Style applied to alternating row cells | |
Style applied to alternating row headers |
Example:
grid.AlternatingRowHeaderBackground = alternatingRowHeaderBackground;
grid.AlternatingRowHeaderForeground = alternatingRowHeaderForeground;Alternating row styling integrates with selection and mouse-over states.
Default selection and hover brushes use semi-transparent rendering so that alternating row backgrounds remain visible during interaction.
FlexGridDetailProvider includes the AlternateDetails property, which determines whether detail rows participate in alternating-row styling.
Configuration | Behavior |
|---|---|
Default behavior | Detail rows participate in alternating-row styling |
| Detail rows use standard row styling without alternating-row formatting |