BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private GridRangeInfo lastSelectedRange = null; private void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e) { if(!e.Range.IsEmpty) this.lastSelectedRange = e.Range; }
Point clickPoint = gridControl1.PointToClient(new Point(e.X, e.Y));
int row, col;
gridControl1.PointToRowCol(clickPoint, out row, out col);
=============
private void gridControl1_DragDrop(object sender, DragEventArgs e) { if(e.Data.GetDataPresent(typeof(GridData))) { GridData data = e.Data.GetData(typeof(GridData)) as GridData; for(int i = 0; i < data.RowCount; i++) { for(int j = 0; j < data.ColCount; ++j) { string s = ""; if(data[i,j] != null) { GridStyleInfo style = new GridStyleInfo(data[i,j]); s = style.Text; } Console.Write(s + "\t"); } Console.WriteLine(); } } }
this.grid.Model.DragDropData
If not, here is how you can compute it. When the drag starts, get the mousedown cell, get the original selected range. From this information, you can get the row and col offsets of the top-left cell of the range from the mouse down cell.
Then on the drop, get the cell of the drop, and then uses the above offset to compute the top-left cell of the drop range.