This is a migrated thread and some comments may be shown as answers.

ListBoxDragDropBehavior-Identify Approach

3 Answers 112 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Kishorekumar
Top achievements
Rank 1
Veteran
Kishorekumar asked on 04 Jan 2021, 09:00 AM

Hi All,

Any Idea to Notify in Drop(DragDropState state) of which Parent Class is ListBoxDragDropBehavior. I am Doing Drag and Drop operation in Rad:ListBox Control. Need to identify whether I am Dragging the ListBoxItem from top to down or down to top in Drop(DragDropState state  method of the behavior. I have attached a sample image(dragvisual.jpg) for reference.

Thanks in Advance!

Regards,

Kishore Kumar

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 08 Jan 2021, 12:40 PM

Hi Kishorekumar,

Thank you for the attached image.

To check if you are going down or up, you can subscribe to the DragOver event of the DragDropManager. You can get the current possible drop point in the event handler and check if it is above the center of the RadListBox or below. You can check the attached project for further reference.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Kishorekumar
Top achievements
Rank 1
Veteran
answered on 12 Jan 2021, 06:41 AM

Hi Dinko,

The above sample which you attached determines the dragging-approach whether top to bottom or bottom to top in View(code-behind). I need it in Drop(DragDropState state) method of Custom(ListBoxbehaviour-dragDrop) behavior for further Validation/restrictions. Can you provide solution  for this problem.

0
Dinko | Tech Support Engineer
Telerik team
answered on 12 Jan 2021, 10:08 AM

Hi Kishorekumar,

You can create a property in the business object that will hold the current drag state. To get the drag object in the DragOver event, you can use the DragDropPayloadManager.GetDataFromObject() method. I have modified the project to demonstrate this approach.

I hope this approach will work for you.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DragAndDrop
Asked by
Kishorekumar
Top achievements
Rank 1
Veteran
Answers by
Dinko | Tech Support Engineer
Telerik team
Kishorekumar
Top achievements
Rank 1
Veteran
Share this question
or