Skip to main content
A newer version of this page is available. .

DataViewBase.IsFocusedCell Attached Property

Gets a value that indicates whether the cell is focused.

Namespace: DevExpress.Xpf.Grid

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

Declaration

Returns

Type Description
Boolean

true if the cell is focused; otherwise, false.

Remarks

XAML Attribute Usage

<Style x:Key="FocusedCellStyle" TargetType="dxg:CellContentPresenter">
    <Style.Triggers>
        <Trigger Property="dxg:TableView.IsFocusedCell" Value="True">
            <Setter Property="Background" Value="Green"/>
            <Setter Property="Foreground" Value="Yellow"/>
        </Trigger>
    </Style.Triggers>
</Style>

Example

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.

Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Windows

Namespace DXGrid_ChangeRowAppearance
    ''' <summary>
    ''' Interaction logic for App.xaml
    ''' </summary>
    Partial Public Class App
        Inherits Application

    End Class
End Namespace
See Also