I have a feature class and bunch of standalone tables which are published as FeatureServer.
In my application I need to provide functionality to update Feature Layer and the associated table. The tables are initialized dynamically to support editing.
I know the two ways to get the active feature layers ( FeatureLayer fLayer = this.MapControl.Layers[layerID] as FeatureLayer; ) and ( IEnumerable<GraphicsLayer> graphicsLayer = featureEditor.GraphicsLayers; foreach (GraphicsLayer gl in graphicsLayer) fLayer = gl as FeatureLayer; )
Both of the above methods are unable to return the table as Feature layer.
How should i get the tables from Editor as Feature Layer?
You create FeatureLayer for each standalone table and do not add them to Map.Layers, is that correct? Are you using FeatureDataForm to update the table? If yes, you cannot expect Map.Layers or Editor.GraphicsLayers to report these layers. What you can do is store them to a different LayerCollection and use this LayerCollection to access layers from standalone tables.