The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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 ?
ADAdministrator Syncfusion Team 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
ADAdministrator Syncfusion Team 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;
ACAndrew CrossSeptember 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;
>