AnsweredAssumed Answered

Move layer from root to nested group layer within MXD without legend changes

Question asked by peterlen on Sep 15, 2014
Latest reply on Sep 15, 2014 by wguidry

Hello - I am using Java Arcobjects (ArcGIS 10.0) to programatically deal with an MXD file.  What I have are MXD files that contain feature layers listed at the root/base of the TOC.  I am programmatically adding nested GroupLayers to MXD file and then I want to move the feature layers from the root/base to a nested GroupLayer.   What I have initially done is successfully added the nested GroupLayers to the MXD file.  If I remove the feature layer from the map document and then add it to the group layer, it works fine.  The problem is that when I remove the feature layer,  the legend is also updated with the removed layer no longer in the legend but when I then add the feature layer to the group layer, the legend is not updated, so the end result is that my MXD TOC looks fine, but the legend is missing my feature layer info.  I can't find a way to either have the feature layer re-added to the legend when it is added to the GroupLayer or do something where the legend is never updated at all.


Any thoughts?


Thanks - Peter