Change Cursor on Condition (Control of the same type)

1 Answer 139 Views
DragAndDrop
Ben
Top achievements
Rank 1
Ben asked on 18 Oct 2021, 09:32 AM

Hi Guys,

We're using a behaviour class that is driven by the DragDropManager, hooking into some of the events, namely GiveFeedback and DragOver.

I'd like to change the cursor to a blocked symbol if the control we're dragging is hovered over another control of the same type.

Within the GiveFeedback event, we're unable to determine what control we're currently hovering over. Instead we tried using the OnDragOver event, where we are able to establish the current position but unable to change the cursor.

Is there any other way to change the cursor without the GiveFeedbackEventArgs?

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 20 Oct 2021, 09:18 AM

Hello Ben,

To achieve your requirement, you can cache the drop target element in the DragOver event handler. Then you can use the cached value in the GiveFeedback event handler in order to decide if the cursor should be overridden. You can find this approach shown in the attached project. I hope that helps.

    Regards,
    Martin Ivanov
    Progress Telerik

    Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
    Tags
    DragAndDrop
    Asked by
    Ben
    Top achievements
    Rank 1
    Answers by
    Martin Ivanov
    Telerik team
    Share this question
    or