OnDrop or OnDropped events are not triggered
Hi,
These two events are not being triggered if the order of the items isn't changed.
If for example I do change the order (swap two items), both events are triggered. But if you return the item at the same position, events are not triggered.
I think they need to be triggered because OnDragStart event does trigger and might do some modifications that need to be reverted on drop.
I think they need to be triggered because OnDragStart event does trigger and might do some modifications that need to be reverted on drop.
SIGN IN To post a reply.
4 Replies
1 reply marked as answer
MK
Mohan Kumar Ramasamy
Syncfusion Team
October 20, 2020 02:46 AM UTC
Hi Mateo,
We have checked your reported query, we can achieve your requirement using using DragStart Dropped event. Please refer below code snippets.
|
<SfListBox Value=@Value DataSource="@Data" TValue="string[]" TItem="DataValues" AllowDragAndDrop="true">
<ListBoxFieldSettings Text="Text" Value="Id"></ListBoxFieldSettings>
<ListBoxEvents DragStart="DragStart" Dropped="Dropped" TValue="string[]" TItem="DataValues"></ListBoxEvents>
</SfListBox>
@code
{
private void DragStart(DragEventArgs<DataValues> args)
{
}
private void Dropped(DragEventArgs<DataValues> args)
{
}
} |
For your reference, we have prepared a sample based on this, please refer below link.
Please let us know, if you need any further assistance.
Regards,
Mohan kumar R
MA
Mateo
October 20, 2020 06:40 PM UTC
Hi, thank you for the provided solution.
Unfortunately I am not able to get desired requirements using mozilla firefox browser.
What I am trying to do is this:
Start drag one item from the list and drop it at the same place without changing the position in the list.
Drag start does trigger while Dropped method doesn't execute.
Drag start does trigger while Dropped method doesn't execute.
It will execute only if the item is dragged over other items and then returned to start position.
Please try this example: Start drag it and immediately drop it, you will find it will not execute.
MK
Mohan Kumar Ramasamy
Syncfusion Team
October 23, 2020 02:57 AM UTC
Hi Mateo,
We have checked your reported requirement, currently Dropped event not trigger when drop the list item in same position. So, we need to provide beforeDrop event and logged this as an improvement. We will provide this any of our upcoming release and appreciate your patience until then.
Regards,
Mohan kumar R
MK
Mohan Kumar Ramasamy
Syncfusion Team
October 30, 2020 02:28 PM UTC
Hi Mateo,
Sorry for the inconvenience caused. We will include this support in our upcoming patch release which will be which will be scheduled on 11th November 2020. Until then we appreciate your patience. You can track the status in the below feedback link.
Regards,
Mohan kumar R
Marked as answer
SIGN IN To post a reply.