Select to view content in your preferred language

How to clear the payload of OnDragOver method in ArcGIS Pro SDK

479
2
05-31-2024 08:04 AM
AbhijeetNandeshwar1
Occasional Contributor

I have created a custom dockpane with two combo boxes. I am implementing Drag and Drop functionality to each combo box. The OnDragover and OnDrop functions work correctly when we use them for the first combo box. How can I clear the payload for the second OnDragover and OnDrop to be used to populate the second combo box.

I tried using dropInfo.Data = null However, it failed to clear the payload for use with the second combo box.

Any inputs would be highly appreciated.

Regards,
Abhijeet

AbhijeetNandeshwar1_0-1717168428385.png

 

Tags (2)
2 Replies
UmaHarano
Esri Regular Contributor

Do you mean - you want to drop 2 different items into the 2 different combo boxes?

You can implement this in your OnDrop callback in the dockpane.  Something like this:

public override async void OnDrop(DropInfo dropInfo)
{
   //eg, if you are accessing a dropped file
   if (dropInfo.Data is List<ClipboardItem> clipboardItems) //Dropped from Catalog 
   {
	 var thisItem = clipboardItems.FirstOrDefault();
	 var itemInfo = thisItem.ItemInfoValue.typeID;
	if (itemInfo == "database_fgdb") //File GDB
	 {
            Name = thisItem.CatalogPath; //binding property for text box control in dockpane
            GDBItems = await GetGDBItemsAsync();
         }
	 if (itemInfo == "cim_map_map") //Map
         MapName = thisItem.CatalogPath; //another binding property for another text box in the dockpane
         ...
}

 

 

AbhijeetNandeshwar1
Occasional Contributor

Thank you Uma. I will try to implement the workflow and will let you know if I face any difficulties.

0 Kudos