Answer the question
In order to leave comments, you need to log in
How to highlight the first row of a DataGrid programmatically in C#?
There is a TextBlock in which the search string is entered, the finished result of the matches is displayed in the DataGrid.
How, when pressing the Enter key in a TextBlock, select to transfer the focus to the DataGrid and select the first element of the table?
if (DataGrid.Items.Count > 0)
{
DataGrid.Focus();
DataGrid.SelectedItem = DataGrid.Items[0];
}
Такой код не прокатил.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question