Skip to main content

DataControlBase.CurrentColumn Property

Gets or sets the focused column.

Namespace: DevExpress.Xpf.Grid

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


public ColumnBase CurrentColumn { get; set; }

Property Value

Type Description

A GridColumn object that represents the focused column.


The CurrentColumn property returns null if the DataViewBase.NavigationStyle property isn’t set to GridViewNavigationStyle.Cell.

To learn more, see Focusing.


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;
See Also