10.0 Engine for .NET TOCControl Group Layer Not Updating

475
3
Jump to solution
08-30-2012 11:40 AM
GlennNead
New Contributor
I have a MapControl with an associated TOCControl as a buddy.

Working with the underlying map, I can add a group layer programmatically.  The group layer shows up properly in the TOC.

Later I programmatically add child groups underneath the group layer as well as feature layers.  When control returns back to the viewer, the features are rendered on the MapControl, but the original group layer is unchanged, as if there were no child layers.  I can interactively change the visibility of the group layer which hides/shows the underlying feature layers, but I can't actually get to them. 

If the layers are added to the map prior to displaying the controls, the layers show up properly in the TOC.

I've tried the refresh method on both the map and TOC controls.

[UPDATE:  Definitely an issue with groups.  If I add multiple group layers to the map itself, they show up in the TOC.  Layers under the group do not show in the TOC.]

Thanks in advance!

  -- Glenn
0 Kudos
1 Solution

Accepted Solutions
JohnHauck
Occasional Contributor II
After you add the layer to the group you can call Update on the TOC.

View solution in original post

0 Kudos
3 Replies
JohnHauck
Occasional Contributor II
After you add the layer to the group you can call Update on the TOC.

View solution in original post

0 Kudos
GlennNead
New Contributor
After you add the layer to the group you can call Update on the TOC.


Time for me to go home for the day.

Thank you.  I saw the refresh method on the control, but did not see the Update method.  That did the trick.

         -- Glenn
0 Kudos
HarshGupta
New Contributor II

sir i populate all the feature layer in toc but unable to group that layer please help me out

0 Kudos