ComponentOne Grid for WPF: Grid for WPF Appearance > Setting Text Alignment

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

C1DataGrid

HeaderCellTextAlignment property

Defines a default text alignment of grid column header captions.

C1DataGrid

ItemCellTextAlignment property

Defines a default text alignment of grid item cell values.

C1DataGrid

TotalResultCellTextAlignment property

Defines a default text alignment of grid column totals.

Column

ActualHeaderCellTextAlignment property

Gets an effective text alignment of column header caption.

Column

ActualItemCellTextAlignment property

Gets an effective text alignment of column item cell values.

Column

ActualTotalResultCellTextAlignment property

Gets an effective text alignment of column total result.

Column

ItemCellTextAlignment property

Defines a text alignment of column item cell values.

Column

HeaderCellTextAlignment property

Defines a text alignment of column header caption.

Column

TotalResultCellTextAlignment property

Defines a text alignment of column total result.

ContentCellPresenterBase

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.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.