ccposton

Get Feature Symbol

Discussion created by ccposton on Feb 8, 2012
Latest reply on Feb 8, 2012 by Neil
I am using this code to get the symbol associated with a feature:
IFeature feature = geoFeatureLayer.FeatureClass.GetFeature( geoFeatureLayer.FeatureClass.FeatureClassID );
geoFeatureLayer.Renderer.get_SymbolByFeature( feature );


Of course, now I have encountered a layer where "FeatureClassID = -1" and this code crashes with "ROW_NOT_FOUND."
The help says: "...IFeatureClass::FeatureClassID will always return -1 for Coverage and Shapefile feature classes."
I (sort of) understand that but how should I get the Symbol for that kind of feature?  Suggestions?

Outcomes