Reputation: 2741
I have a datagrid with multiple rows and If I select multiple rows and while editing a row if I press tab key I looses selection on the selected rows,Only current row is selected. I need all other rows to be selected without losing selection.
Please help.
Before Tab
After Tab
Upvotes: 3
Views: 198
Reputation: 9827
Handle Unselected
event of the DataGridRow. This is however just an idea, as it wont allow you to Unselect
any row. But you can build upon this further, checking for Ctrl key pressed etc.
void DataGridRow_Unselected(object sender, RoutedEventArgs e)
{
DataGridRow row = sender as DataGridRow;
Task.Factory.StartNew(() =>
{
Application.Current.Dispatcher.Invoke(() => { row.IsSelected = true; });
});
}
Upvotes: 1