<Application.Resources> <ResourceDictionary> <Style TargetType="sfgrid:GridCell" x:Key="gridCellStyle"> <Setter Property="BackgroundColor" Value="Green"></Setter> <Setter Property="Foreground" Value="Red"></Setter> </Style> </ResourceDictionary> </Application.Resources> |
<sfgrid:SfDataGrid.Columns x:TypeArguments="sfgrid:Columns"> <sfgrid:GridTextColumn MappingName="OrderID" CellStyle="{StaticResource gridCellStyle}"> </sfgrid:GridTextColumn> </sfgrid:SfDataGrid.Columns> |
<Application.Resources>
<ResourceDictionary>
<Style x:Key="labelStyle" TargetType="Label" >
<Setter Property="TextColor" Value="Red"></Setter>
<Setter Property="FontSize" Value="Large"></Setter>
</Style>
</ResourceDictionary>
</Application.Resources> |
<sfgrid:GridTemplateColumn MappingName="ShippingDate" >
<sfgrid:GridTemplateColumn.CellTemplate>
<DataTemplate>
<Label Text="{Binding ShippingDate, StringFormat='{0:dd/MM/yyyy}'}}" Style="{StaticResource labelStyle}"/>
</DataTemplate>
</sfgrid:GridTemplateColumn.CellTemplate>
</sfgrid:GridTemplateColumn> |