Hello
I'm trying to do basic drag and drop from DataGrid control. The problem
is that after I start DoDragDrop, items in DataGrid will become
unselected. I wish them to remian selected.
I hav such code:
private void dataGrid_MouseD own(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
if (e.Button == MouseButtons.Le ft)
{
System.Drawing. Point point = new Point(e.X, e.Y);
DataGrid.HitTes tInfo hit= dataGridLista.H itTest(point);
if(hit.Type == DataGrid.HitTes tType.Cell)
{
this.DoDragDrop (this.PozycjaRe korduWDatasecie ,DragDropEffect s.None);
dataGridLista.C urrentCell = new DataGridCell(hi t.Row, hit.Column);
dataGridLista.S elect(hit.Row);
}
}
}
If I comment uot yhis.DoDragDrop , the item will be selected. Otherwise
it is on.
Note that I have to select whole row, not just one cell.
--
Semper Fidelis
Adam Klobukowski
at***@gabo.pl