Setting Text Alignment
In the 2009 v1 release, Grid for WPF added several options for grid text alignment. Now it's easy to specify how grid content will be aligned or justified.
The following alignment properties are included in the grid:
Class |
Member |
Description |
HeaderCellTextAlignment property |
Defines a default text alignment of grid column header captions. | |
ItemCellTextAlignment property |
Defines a default text alignment of grid item cell values. | |
TotalResultCellTextAlignment property |
Defines a default text alignment of grid column totals. | |
ActualHeaderCellTextAlignment property |
Gets an effective text alignment of column header caption. | |
ActualItemCellTextAlignment property |
Gets an effective text alignment of column item cell values. | |
ActualTotalResultCellTextAlignment property |
Gets an effective text alignment of column total result. | |
ItemCellTextAlignment property |
Defines a text alignment of column item cell values. | |
HeaderCellTextAlignment property |
Defines a text alignment of column header caption. | |
TotalResultCellTextAlignment property |
Defines a text alignment of column total result. | |
TextAlignment property |
Gets cell's text alignment |
Using the GridTextAlignment enumeration you can justify various elements of the grid by setting their alignment to General (default), Left, Right, Center, or Justify:
Option |
Description |
General (default) |
Text will be left-aligned for string end enumeration types, right aligned for date and numeric types, and centered for Boolean values. |
Left |
All text will be left-aligned. |
Right |
All text will be right-aligned. |
Center |
All text will be centered. |
Justify |
All text will be justified and equally spaced. |
|