Actually i am trying to create toc control to my application. If once i unchecked the layer in the datagrid by using the following code it is hiding from the map..
myserviceid.visiblelayers.deleteitemat(layerinfo.id);
but if i use the following code it is not visible again..........
var lyr:layer=layerinfos[1] as layerinfo;
myserviceid.visiblelayers.additemat(layer,index)
what are the necesary changes i need here.....
thanks......