Drag and Drop layer

700
2
05-08-2014 08:12 PM
RichardMoussopo
Occasional Contributor III
Hi all,
Any way to drag a layer from the TOC and drop it into a combobox on a form? As the image below, I created a dockable window where I have two comboboxes: I want to populate the 1st one with the dropped layer name and the second one with the fields of that layer.

[ATTACH=CONFIG]33696[/ATTACH]
0 Kudos
2 Replies
AhmedEl-Sisi
Occasional Contributor III
Hi all,
Any way to drag a layer from the TOC and drop it into a combobox on a form? As the image below, I created a dockable window where I have two comboboxes: I want to populate the 1st one with the dropped layer name and the second one with the fields of that layer.

[ATTACH=CONFIG]33696[/ATTACH]


I found an interesting post which explains how to do this.
http://kiwigis.blogspot.com/2011/07/how-to-create-drop-target-for-layers-in.html

Basically you will deserialize drooped object which is packaged as "ESRI Layers" and then add it to your Combobox.

I have attached sample code using 10.1 SDK

Regards,
RichardMoussopo
Occasional Contributor III

Thanks Ahmed,

This is very helpful. Thank you.

0 Kudos