Skip to main content

DataViewBase.FocusedRowHandle Property

Gets or sets the focused row’s handle. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core


public int FocusedRowHandle { get; set; }

Property Value

Type Description

An integer value that specifies the focused row’s handle.


The focused row is not displayed if the DataViewBase.NavigationStyle property is set to GridViewNavigationStyle.None.

To specify the focused row, use the FocusedRowHandle property or the DataViewBase.MoveFocusedRow method. If the specified row is not visible onscreen, a View is automatically scrolled to make the focused row visible.

After the focused row has been changed, the DataViewBase.FocusedRowHandleChanged event is raised.


This example shows how to identify a data cell with the specified value and focus it. To do this, click the Focus Cell button.

Grid - Focus a Row with the Specified Value

View Example: Focus a Cell with the Specified Value

        <RowDefinition Height="Auto"/>
    <dxg:GridControl Name="grid" AutoGenerateColumns="AddNew">
            <dxg:TableView x:Name="view" AutoWidth="True" FadeSelectionOnLostFocus="False"/>
    <StackPanel Grid.Row="1" Orientation="Horizontal">
        <TextBlock Text="Unit Price:" TextAlignment="Right" Padding="4"/>
        <TextBox x:Name="textBox" Width="50" Margin="0,0,5,0" HorizontalAlignment="Left"/>
        <Button  Content="Focus Cell" HorizontalAlignment="Left" Click="FocusCell"/>
void FocusCell(object sender, RoutedEventArgs e) {
    if (!double.TryParse(textBox.Text, out double textValue))
    var rowHandle = grid.FindRowByValue(grid.Columns[nameof(Product.UnitPrice)], textValue);
    if (rowHandle == DataControlBase.InvalidRowHandle) 
    grid.CurrentColumn = grid.Columns[nameof(Product.UnitPrice)];
    view.FocusedRowHandle = rowHandle;

The following code snippets (auto-collected from DevExpress Examples) contain references to the FocusedRowHandle property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also