I can set the focus with only XAML to a Datagrid.
It eludes me how (if possible at all) how to set focus to the first row with only XAML.
My (shortened) XAML:
<Window x:Class="WhatIsInTheBarnBooth.MainWindow"
...
FocusManager.FocusedElement="{Binding ElementName=grdData}">
</Window>
<DataGrid Name="grdData">
...
</DataGrid>
Can you try....
FocusManager.FocusedElement="{Binding ElementName=myDataGrid}"
and
<DataGrid Name="grdData" SelectedIndex="0">
...
</DataGrid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With