A newer version of this page is available. Switch to the current version.

TableView.RowStyle Property

Gets or sets the style applied to data rows. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.2.dll


public Style RowStyle { get; set; }

Property Value

Type Description

A Style object that is the style applied to data rows.


The RowStyle property specifies the style that groups together properties, resources, and event handlers and shares them between instances of the GridRowContent type.

Target Type:

Optimized mode Non-optimized mode
DevExpress.Xpf.Grid.RowControl GridRowContent

Refer to the following topic for more information: Appearance Customization.

Data Binding

Row elements contain RowData objects in their DataContext.

Use the following binding paths to access cell values and ViewModel properties:

  • Row.[YourPropertyName] - access a property of an object in the ItemsSource collection;
  • DataContext.[FieldName] - access a column value;
  • View.DataContext.[YourPropertyName] - access a property in a grid’s ViewModel.


The complete sample project is available in the following repository: https://github.com/DevExpress-Examples/how-to-build-binding-paths-in-gridcontrol-rows.


This example demonstrates how to use the View's RowStyle and CellStyle properties to apply custom styles to the focused row and cell. To identify whether the row and cell are focused, the attached IsFocusedRow and IsFocusedCell properties are used.

View Example

<Window x:Class="DXGrid_ChangeRowAppearance.Window1"
        Title="Window1" Height="300" Width="505">
        <Style x:Key="FocusedCellStyle" TargetType="dxg:LightweightCellEditor">
                 <Trigger Property="dxg:DataViewBase.IsFocusedCell" Value="True">
                    <Setter Property="Background" Value="Green" />
                    <Setter Property="Foreground" Value="Yellow" />
        <Style x:Key="FocusedRowStyle" TargetType="dxg:RowControl">
                <Trigger Property="dxg:DataViewBase.IsFocusedRow" Value="True">
                    <Setter Property="Background" Value="Gray" />
                    <Setter Property="Foreground" Value="White" />
        <dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
                <dxg:TableView AutoWidth="True" ShowGroupPanel="False" 
                               CellStyle="{StaticResource FocusedCellStyle}" 
                               RowStyle="{StaticResource FocusedRowStyle}" />
using System.Windows;
using System.Collections.Generic;

namespace DXGrid_ChangeRowAppearance {
    public partial class Window1 : Window {
        public Window1() {
            grid.ItemsSource = Products.GetData();
        public class Products {
            public static List<Product> GetData() {
                List<Product> data = new List<Product>();
               data.Add(new Product() { ProductName = "Chai", 
                    UnitPrice = 18, UnitsOnOrder = 10 });
                data.Add(new Product() { ProductName = "Ipoh Coffee",
                    UnitPrice = 36.8, UnitsOnOrder = 12 });
                data.Add(new Product() { ProductName = "Outback Lager",
                    UnitPrice = 12, UnitsOnOrder = 25 });
                data.Add(new Product() { ProductName = "Boston Crab Meat",
                    UnitPrice = 18.4, UnitsOnOrder = 18 });
                data.Add(new Product() { ProductName = "Konbu",
                    UnitPrice = 6, UnitsOnOrder = 24 });
                return data;
        public class Product {
            public string ProductName { get; set; }
            public double UnitPrice { get; set; }
            public int UnitsOnOrder { get; set; }
See Also