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