I have the following snippit of code to perform this. However, it doesn't do anything to the layer in the TOC on the map that gets generated from this code. When the layer is created and the map shows up, the layer appears expanded. I want it to collapse. Am I doing something wrong? Thanks.
IMap aMap = axMapControl1.ActiveView.FocusMap;
ILayer pLayer = aMap.get_Layer(0);
INALayer2 anNALyr = (INALayer2)pLayer;
anNALyr.Expanded = false;
axTOCControl1.Refresh();
Also, how do I get a layer in the TOC to move to the bottom of the TOC?