How to programatically update the dynamic layer name in TOC

264
3
Jump to solution
03-04-2014 12:24 PM
Highlighted
New Contributor II
This is probably been asked before, but using the search criteria of TOC update label (and others), did not
reveal the answer for me.

When creating a dynamic layer, and adding it to the map, the initial name is "Dynamic Layer".

After initialization or loading of data, I get the real name so I rename that layer programmatically.

However, the name is not updated in the TOC. It is not a repainting issue since I can force a repaint and the new
name does not appear.

When I look at the layer properties, the Layer Name is correct, but not the label on the TOC. When apply is clicked,
the TOC label is updated correctly.

[ATTACH=CONFIG]31937[/ATTACH]

How can I programmatically update the layer name in the TOC
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor III
Are you calling IMxDocument.UpdateContents after changing the layer name?

View solution in original post

Reply
0 Kudos
3 Replies
Highlighted
Regular Contributor III
Are you calling IMxDocument.UpdateContents after changing the layer name?

View solution in original post

Reply
0 Kudos
Highlighted
New Contributor II
That worked.

Thanks a lot.
Reply
0 Kudos
Highlighted
Regular Contributor
Please mark Mr. Clemmons' response as the answer.
Reply
0 Kudos