Hi,
SelectionMode="Extended" are OK there. You can write this line of code inside of your Selection_Changed event from the DataGrid:
private void Dg_Dati_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (this.Dg_Dati.SelectedItems != null)
{
if (this.Dg_Dati.SelectedItems.Count == 0)
{
MessageBox.Show("The user has deselected all rows");
return;
}
if (this.Dg_Dati.SelectedItems.Count == this.Dg_Dati.Items.Count)
{
MessageBox.Show("The user has selected all rows");
return;
}
}
}
Hope it helps.