Set the Text Alignment on Column Headers
Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. For help or questions on migrating your codebase to the XamDataGrid, please contact support.
Setting the property on the Column takes precedence over setting the property on the ColumnLayout.
Setting the property on the ColumnLayout takes precedence over setting the property on xamGrid.
The Column and the ColumnLayout have two additional properties:
These two read-only properties are used to validate the actual value for a particular ColumnLayout or Column.
Note
|
Note:
The ColumnLayout and Column’s HeaderTextHorizontalAlignment and HeaderTextVerticalAlignment are nullable enums, therefore there will not be any intellisense for them in XAML. However, xamGrid’s HeaderTextHorizontalAlignment and HeaderTextVerticalAlignment properties are not nullable and will therefore have intellisense.
|
<ig:XamGrid x:Name="MyDataGrid" ItemsSource="{Binding Source={StaticResource DataUtil}, Path=CategoriesAndProducts}"
AutoGenerateColumns="False" HeaderTextHorizontalAlignment="Right">
<ig:XamGrid.Columns>
<ig:TextColumn Key="CategoryID"/>
<ig:TextColumn Key="CategoryName" HeaderTextHorizontalAlignment="Left" />
</ig:XamGrid.Columns>
</ig:XamGrid>
MyDataGrid.HeaderTextHorizontalAlignment = HorizontalAlignment.Right
MyDataGrid.Columns.DataColumns("CategoryName").HeaderTextHorizontalAlignment = HorizontalAlignment.Left
MyDataGrid.HeaderTextHorizontalAlignment = HorizontalAlignment.Right;
MyDataGrid.Columns.DataColumns["CategoryName"].HeaderTextHorizontalAlignment = HorizontalAlignment.Left;