|119221||May 25,2015 03:40 AM||May 26,2015 10:18 PM||WinRT||3|
dataGrid.SelectionMode = GridSelectionMode.Multiple;
dataGrid.SelectionUnit = GridSelectionUnit.Row;
I'm trying to select some rows of the grid when the user push a button (the grid is on screen). I do this:
dataGrid.SelectedItems.Add( myItemSourceItem );
dataGrid.SelectedItems.Add( myItemSourceItem2 );
Where myItemSourceItem and myItemSourceItem2, are contained in ItemsSource.
The problem is that de rows than not seems to be selected visualy.
However the dataGrid.SelectAll() methods works properly and select all rows as aspected. Am I forgetting something?
Thanks in advance!
private void Button_Click(object sender, RoutedEventArgs e)
var viewModel = sfDataGrid.DataContext as ViewModel;
var selectedItem = viewModel.OrderDetails;
var secondItem = viewModel.OrderDetails;
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.