Dmitriy,
thanks for your concern, I immediately tested it, but when pressing the
shift or control button I can still only select one row....maybe because
of my additional methods at the mouseclick and mousemove events... let
me show them:
private void dataGridClients_MouseMove(object sender, MouseEventArgs e)
{
this.mouseX = e.X; // global variables
this.mouseY = e.Y;
}
private void dataGridClients_Click(object sender,
EventArgs e)
{
System.Windows.Forms.DataGrid.HitTestInfo myHitTest =
this.dataGridClients.HitTest(mouseX,mouseY);
if (myHitTest.Type == DataGrid.HitTestType.RowHeader)
{
for(int i = 0 ; i < this.dataGridClients.VisibleRowCount; i++)
{
this.dataGridClients.UnSelect(i);
}
this.dataGridClients.Select(myHitTest.Row);
}
}
this one I also implemented. But it's for when people navigate through
the datagrid with the arrow keys:
private void dataGridClients_CurrentCellChanged(object sender, EventArgs
e)
{
for(int i = 0 ; i < this.dataGridClients.VisibleRowCount; i++)
{
this.dataGridClients.UnSelect(i);
}
this.dataGridClients.Select(this.dataGridClients.CurrentRowIndex);
}