Skip to main content

RowStyleBase.Padding Property

Gets or sets the space between the grid element’s borders and its content.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

NuGet Package: DevExpress.XamarinForms.Grid

Declaration

[XtraSerializableProperty]
public Thickness Padding { get; set; }

Property Value

Type Description
Thickness

The Thickness structure instance that defines the grid element’s inner indents.

Remarks

When you use the Padding property of the CellStyle object to change grid cell paddings, the specified value is applied to cells of the TextColumn, NumberColumn, DateColumn and PickerColumn columns.

To specify cell paddings for the CheckBoxColumn and ImageColumn columns, use the CellStyle.CheckBoxPadding and CellStyle.ImagePadding property.

Example

This example shows how to modify the appearance of the following grid elements:

View Example

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:dxg="http://schemas.devexpress.com/xamarin/2014/forms/datagrid"
             xmlns:local="clr-namespace:DataGrid_CustomAppearance"
             x:Class="DataGrid_CustomAppearance.MainPage">
    <ContentPage.BindingContext>
        <local:TestOrderRepository/>
    </ContentPage.BindingContext>
    <dxg:DataGridView ItemsSource="{Binding Orders}" 
                      RowHeight="40" TotalSummaryHeight="40">

        <!-- Specify grid columns and total summaries here. -->

        <!--Customize the appearance of grid cells.-->
        <dxg:DataGridView.CellStyle>
            <dxg:CellStyle Padding="5" BackgroundColor="#333333" BorderColor="#515151"
                           FontSize="14" FontColor="White" 
                           SelectionColor="#f78a09" SelectionFontColor="Black"/>
        </dxg:DataGridView.CellStyle>

        <!--Customize the appearance of column headers.-->
        <dxg:DataGridView.ColumnHeaderStyle>
            <dxg:ColumnHeaderStyle BackgroundColor="#333333" BorderColor="#515151" 
                                   FontSize="16" FontColor="#929292" FontAttributes="Bold" 
                                   HorizontalLineThickness="2"/>
        </dxg:DataGridView.ColumnHeaderStyle>

        <!--Customize the appearance of the total summary panel.-->
        <dxg:DataGridView.TotalSummaryStyle>
            <dxg:TotalSummaryStyle Padding="2,10" BackgroundColor="#666666" BorderColor="#515151"
                                   FontSize="14" FontColor="#f78a09"/>
        </dxg:DataGridView.TotalSummaryStyle>
    </dxg:DataGridView>
</ContentPage>

Grid Custom Appearance

See Also