Is it possible to change the version at the feature service level, instead of iterating and changing it at each individual featurelayer level for the current active map?
MapView.Active.Map.ChangeVersion(fromVersion, toVersion);
Thanks Gurunara. Is it possible to change version of few feature instead of entire map. I want to show feature layer in default version as well as same feature layer in different version.
Below changes the map's version
FeatureLayer featureLayer = (FeatureLayer)LayerFactory.Instance.CreateLayer(new Uri(queryUrl), MapView.Active.Map);featureLayer.SetDefinitionQuery(query);var dataStore = featureLayer.GetFeatureClass().GetDatastore();// Create a geodatabase from the feature service URLGeodatabase geodatabase = dataStore as Geodatabase; //casting to Geodatabaseif (geodatabase == null)return;VersionManager versionManager = geodatabase.GetVersionManager();ArcGIS.Core.Data.Version currentVersion = versionManager.GetCurrentVersion();
//Getting all available versions except the current oneArcGIS.Core.Data.Version toVersion = versionManager.GetVersion("versionName");
if (toVersion != null){//Changing versionMapView.Active.Map.ChangeVersion(currentVersion, toVersion);}
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.