Is there a way to do multi-selction on with the standard datagrid? (I am using the compact framework.)
This is what I ended up doing:
readonly List<int> _selectedRows = new List<int>();
private void dataGrid1_MouseUp(object sender, MouseEventArgs e)
{
int c = dataGrid1.CurrentRowIndex;
if (_selectedRows.Contains(c))
{
dataGrid1.UnSelect(c);
_selectedRows.Remove(c);
// Take focus off the current row if I can
if (_selectedRows.Count > 0)
dataGrid1.CurrentRowIndex = _selectedRows[0];
}
else
{
_selectedRows.Add(c);
}
foreach (int rowIndex in _selectedRows)
{
dataGrid1.Select(rowIndex);
}
}
Kind of a poor man's mulit select, but it works.