Keyboard focus to DataGrid

后端 未结 3 479
陌清茗
陌清茗 2021-01-18 01:10

I have a WPF DataGrid and want to set the focus to the first item so that the user can navigate with the keyboard in the list of items, when the dialogue is opened the first

3条回答
  •  北海茫月
    2021-01-18 01:30

    Try giving keyboard focus manually using Keyboard.Focus -

    Keyboard.Focus(dataGrid);
    

提交回复
热议问题