Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a simple ArcMap Add-in that displays all featureclass names in a database inside of a ListBox. If I select a name or multiple names in the listbox, how can I drag and drop it in ArcMap? Just to give a quick summary, the purpose of this add-in is because the database has encrypted names and I have to show the "friendly names" in the ListBox control so I will use a special refrence table in SQL to populate the listbox with the friendly names.

share|improve this question
    
Encrypted names? Can you give an example? –  blah238 Feb 21 '13 at 19:48
    
@blah238 sorry I meant ArcMap not Catalog. I've corrected my question and tags. –  DaBears Feb 21 '13 at 19:56
    
What? That wasn't my question at all. What do you mean by "encrypted names"? –  blah238 Feb 21 '13 at 20:30
    
Wells Featureclass = G01P01L0023 in sde –  DaBears Feb 21 '13 at 21:02
    
Well that's weird. –  blah238 Feb 21 '13 at 21:20
add comment

2 Answers 2

up vote 1 down vote accepted

This is just an idea and an alternative to drag 'n' drop. It sounds like you have a list box on a form that is being populated with friendly names. I'm guessing these will be simply text entries? Instead of trying to drag 'n' drop why not have a button that when clicked reads the selected items (your table names) in the list box, connects to the workspace and loads them into the map?

I would image that would be easier to implement unless drag 'n' drop is specifically required?

share|improve this answer
    
yes that approach does sound easier. if I were to use a button to load the layers into arcmap how do I get access to the activeview? –  DaBears Feb 22 '13 at 14:01
    
In 10.1 VB .net it would be: Dim pMXDocument As IMxDocument pMXDocument = My.ArcMap.Document Dim pMap As IMap pMap = pMXDocument.FocusMap –  Hornbydd Feb 22 '13 at 14:53
    
Thanks this worked for me and I was able to add layers from my addin to my arcmap session –  DaBears Feb 22 '13 at 16:26
add comment

I think you need to implement IGxObject and display your objects in a GxContentsView. See the Catalog and CatalogUI library overviews.

Another possibility might be to use the IDataObjectHelper. See Richie Carmichael's blog post on this topic.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.