I try to copy a layer with subtypes between two dataframes. The symbology is defined on the subtype field. After copy, the value field in the renderer is reset to the first field in the layer. If I change the name of the new layer to something different, it seems to behave better.
I'm trying to make side-by-side comparison. Copying the whole map doesn't help. Even layerfile doesn't help.
What did I do wrong in the copy code? How should I copy a layer (with subtypes) in ArcMap? Thanks.
IObjectCopy copier = new ObjectCopyClass();
var newLayer = copier.Copy(oldLayer) as ILayer;
// ArcMap?? Bad subtypes renderer after copy. Workaround.
newLayer.Name = "name differs from old layer name";