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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing the cursor when dragging over a grid

Thread ID:

Created:

Updated:

Platform:

Replies:

18480 Sep 1,2004 09:35 AM UTC Sep 1,2004 10:32 AM UTC WinForms 3
loading
Tags: GridControl
Andrew Cross
Asked On September 1, 2004 09:35 AM UTC

Hi I have a tree control and when I drag a node off the tree over a grid I want to change the cursor to reflect if the node can be dropped onto the grid. I have set the AllowDrop on the grid and have implemented handlers for the DragDrop and DragOver events for the grid and in the DragOver handler I check for the type of data being dragged over the grid and set the effect to either DragDropEffects.None or DragDropEffects.Copy however setting these see effects makes no difference to the cursor. This code works on other controls but not on the grid. Any ideas ?

Administrator [Syncfusion]
Replied On September 1, 2004 09:58 AM UTC

The grid uses a mouse controller architecture to control cursors. There are two ways you can change the cursor. One is to implement your own mouse controller, and the other is to derive the grid, and override OnSetCursor. Here is a forum thread that has samples for both techniques. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=8551 But since you want to handle a D&D cursor, you have another option. That option is to tie into the grid''s default D&D support by having your dataobject implement IGridDataObjectConsumer. Here is a forum thread that includes a sample that drops a treenode onto a grid using a IGridDataObjectConsumer implmentation. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=5467

Administrator [Syncfusion]
Replied On September 1, 2004 10:00 AM UTC

Oh, one other thing. You existing code may work if you turn off the grid''d default support for D&D. grid.Model.Options.ControllerOptions = grid.Model.Options.ControllerOptions & ~GridControllerOptions.OleDropTarget;

Andrew Cross
Replied On September 1, 2004 10:32 AM UTC

Cheers Turning the grids D&D support off worked Many Thanks Andy >Oh, one other thing. You existing code may work if you turn off the grid''d default support for D&D. > >grid.Model.Options.ControllerOptions = grid.Model.Options.ControllerOptions & ~GridControllerOptions.OleDropTarget; >

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;