can anyone tell me if there is a quick way to establish which cell the mouse is positioned over? I guess I'm looking for an equivalent to the standard tree control's GetNodeAt(X, Y) method.
Thanks in advance
ADAdministrator Syncfusion Team August 11, 2003 11:36 AM
You can use the GridControl1.PointToRowCol method.
Point clickPoint = gridControl1.PointToClient (Cursor.Position);
int row, col;
gridControl1.PointToRowCol(clickPoint, out row, out col);
this.label1.Text = col.ToString();
DLDavid LoomesAugust 11, 2003 02:13 PM
Many thanks, I found this function eventually!
There appears to be a problem with the drag/drop behaviour, the DragOver event is unable to change the displayed cursor by changing e.Allowed in the usual way, and DragDrop seems only to be fired after the grid has completed its own drop handling. I managed to get round this by creating my own grid derived from GridControl and overriding OnDragOver and OnDragDrop to pass control to a new event handler. The code (in C++) is below, but this seems like a lot of trouble to go to to get normal drag/drop handling, and inevitably leads to yet another dll in my project.
Hope this is of some use!
public __gc class MyGridControl : public Syncfusion::Windows::Forms::Grid::GridControl
__event DragEventHandler *MyDragOver, *MyDragDrop;
Void OnDragDrop(System::Windows::Forms::DragEventArgs __gc *e)
Void OnDragOver(System::Windows::Forms::DragEventArgs __gc *e)