Prevent Removal of Items on Drag and Drop

Is there a setting within SFListBox to prevent items from being deleted from a list when dragging and dropping.  For Example, I have items in ListA and drag items to ListB but I don't want the items removed from ListA.  To be clear, items in list A to be copied to List B when dragging.


3 Replies

JS Janakiraman Sakthivel Syncfusion Team October 2, 2021 03:50 AM UTC

Hi John,  
  
Thank you for contacting Syncfusion support.  
  
We have checked your reported requirement and we need to validate more on this. So, we will update you the further details on October 4th, 2021. We appreciate your patience until then.  
  
Regards,  
Janakiraman S.  



SU Subash February 10, 2022 10:31 AM UTC

Has there been any update on this Query? I am really interested in this.



JS Janakiraman Sakthivel Syncfusion Team February 14, 2022 01:38 PM UTC

Hi John, 
 
We can achieve your requirement by using the Dropped event as shown in the code below. 
 
[Index.razor]:  
<ListBoxEvents TItem="CountryCode" TValue="string[]" Dropped="Dropped"></ListBoxEvents> 
public async Task Dropped(DragEventArgs<CountryCode> args) 
{ 
    await ListObj.AddItems(args.Items, (int)args.PreviousIndex); 
} 
  
For your convenience, we have prepared the sample based on your requirement. Please find the link below. 
 
 
 
Could you please check the above links and get back to us, if you need any further assistance on this.  
 
Regards,  
Janakiraman S. 


Loader.
Up arrow icon