We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Where is the mouse

Thread ID:

Created:

Updated:

Platform:

Replies:

6381 Aug 11,2003 01:59 PM UTC Aug 11,2003 06:13 PM UTC Windows Forms 2
loading
Tags: GridControl
David Loomes
Asked On August 11, 2003 01:59 PM UTC

Hi, 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 David Loomes

Administrator [Syncfusion]
Replied On August 11, 2003 03:36 PM UTC

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();

David Loomes
Replied On August 11, 2003 06:13 PM UTC

Clay, 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 { public: __event DragEventHandler *MyDragOver, *MyDragDrop; Void OnDragDrop(System::Windows::Forms::DragEventArgs __gc *e) { if (MyDragDrop) MyDragDrop->Invoke(this, e); } Void OnDragOver(System::Windows::Forms::DragEventArgs __gc *e) { if (MyDragOver) MyDragOver->Invoke(this, e); } };

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;