Skip to main content

DataViewBase.IsFocusedCell Attached Property

Gets a value that indicates whether the cell is focused.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core



Type Description

true if the cell is focused; otherwise, false.


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.

Custom Focused Row and Cell Appearance

View Example: Change the Appearance of Focused Rows and Cells

    <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"
                           CellStyle="{StaticResource FocusedCellStyle}" 
                           RowStyle="{StaticResource FocusedRowStyle}"/>
See Also