New answers tagged


This should answer your question:


You can not cast a FeatureClass into a ILayer! Here's the proper way to reach an ILayer from a FeatureClass: .... IFeatureLayer fl = new ESRI.ArcGIS.Carto.FeatureLayer() fl.FeatureClass = FC; var l = fl as ILayer; axMapControl1.AddLayer(l); I am assuming all of your previous methods are correct and you have a valid IFeatuerClass (FC).


More generally, perhaps the question should be "How can I persist PropertySets in an Mxd?" If so, use an extension, implementing both IExtension and IPersistVariant. See "How to persist data in a document". It's from 9.3, but still relevant.

Top 50 recent answers are included