This project is read-only.

Move layer within group....

Dec 24, 2012 at 11:32 AM
Edited Dec 24, 2012 at 11:34 AM


I am developing an application with mapwingis ocx. I have created number of groups in legend. Now I would like to move all polygon layers to bottom within a particular group of layers. I looping through all the layers. 

if (sf.ShapefileType == MapWinGIS.ShpfileType.SHP_POLYGON)
   int layerHandle = legend1.Map.get_LayerHandle(layerCnt);
   int groupHandle = legend1.Layers.GroupOf(layerHandle);
   bool res = legend1.Layers.MoveLayer(layerHandle,groupHandle,legend1.Groups[groupHandle].LayerCount);


But it isn't working. Could anyone please help me out. 


Dec 27, 2012 at 10:54 AM

Are you sure the layer isn't moved down? Perhaps the legend isn't updated.

You should be able to get the current position of the layer to check.