HeaderStyle Class
Stores the column header appearance settings.
Namespace: DevExpress.XamarinForms.DataGrid
Assembly: DevExpress.XamarinForms.Grid.dll
Declaration
public class HeaderStyle :
RowStyleBase
Related API Members
The following members return HeaderStyle objects:
Remarks
The HeaderStyle class provides properties to customize the following appearance parameters of a column header:
You can specify a style and apply it to grid’s column headers in one of the following ways:
Assign a HeaderStyle object with the specified properties to the DataGridView.HeaderStyle property.
Create a Style class instance with the specified collection of Setter objects, and set the Style.TargetType property to HeaderStyle.
Example
This example shows how to modify the appearance of the following grid elements:
- Data Cells
Assign the CellStyle object with the specified settings to the DataGridView.CellStyle property. Use the grid’s RowHeight property to specify the cell height. - Columns Headers
Assign theHeaderStyle
object with the specified settings to the DataGridView.HeaderStyle property. - Total Summary Panel
Assign the TotalSummaryStyle object with the specified settings to the DataGridView.TotalSummaryStyle property. Use the grid’s TotalSummaryHeight property to change the height of the total summary panel displayed at the bottom of the grid.
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DataGridExample.MainPage"
xmlns:dxg="clr-namespace:DevExpress.XamarinForms.DataGrid;assembly=DevExpress.XamarinForms.Grid">
<dxg:DataGridView x:Name="grid" ItemsSource="{Binding Orders}"
RowHeight="35" TotalSummaryHeight="35">
<!-- Specify grid columns and total summaries here. -->
<!--Customize the appearance of grid cells.-->
<dxg:DataGridView.CellStyle>
<dxg:CellStyle Padding="5,5,5,5" BackgroundColor="#333333" BorderColor="#515151"
FontSize="8" FontColor="White"
SelectionColor="#f78a09" SelectionFontColor="Black"/>
</dxg:DataGridView.CellStyle>
<!--Customize the appearance of column headers.-->
<dxg:DataGridView.HeaderStyle>
<dxg:HeaderStyle BackgroundColor="#333333" BorderColor="#515151"
FontSize="12" FontColor="#929292" FontAttributes="Bold"
HorizontalLineThickness="2"/>
</dxg:DataGridView.HeaderStyle>
<!--Customize the appearance of the total summary panel.-->
<dxg:DataGridView.TotalSummaryStyle>
<dxg:TotalSummaryStyle Padding="2,5,2,5" BackgroundColor="#666666" BorderColor="#515151"
FontSize="8" FontColor="#f78a09"/>
</dxg:DataGridView.TotalSummaryStyle>
</dxg:DataGridView>
</ContentPage>
Inheritance
Object
Xamarin.Forms.BindableObject
Xamarin.Forms.Element
StyleBase
RowStyleBase
HeaderStyle
See Also