XamDataGrid 箭头键导航不起作用

问题描述 投票:0回答:1

我有一个非常简单的 XamDataGrid,其中包含不想使用箭头键导航的测试数据。

XAML:

<dataPresenter:XamDataGrid x:Name="testGrid" Grid.Row="1" Grid.Column="3" DataSource="{Binding Tests}" />

视图模型:

private ObservableCollection<string> tests = new ObservableCollection<string> { "one", "two", "three", "four", "five" };

public ObservableCollection<string> Tests
{
    get => tests;
    set
    {
        tests = value;
        RaisePropertyChanged(nameof(Tests));
    }
}

我做错了什么?

c# xaml infragistics
1个回答
0
投票

尝试在激活窗口时以编程方式将焦点设置在

XamDataGrid
上:

public MainWindow()
{
    InitializeComponent();
    testGrid.Focus();
}
© www.soinside.com 2019 - 2024. All rights reserved.