Is there a way to display new sets of features on the map without deleting existing or currently diplayed ones?Initially, when the page loads for the first time, I display on screen a set of features (cf. XAML code below):<esri:FeatureLayer ID="MyMeters" Renderer="{StaticResource AlertTypesRenderer}" Where="AlertType = 14" ... />
At run time, the user has a set of check boxes to display any other alerts and remove from the screen the previously loaded ones (cf. C# code bewlow):ESRI.ArcGIS.Client.FeatureLayer fs = new ESRI.ArcGIS.Client.FeatureLayer();
fs.Where = "AlertType = 11";
At this point, the user has checked-off the "14" and checked the "11" alerts. If I call a "ClearGraphics" method on the feature layer right before displaying the new features, "ClearGraphics" actually deletes the previous features permanently from the feature service! Hence, I create a new instance of the "FeatureLayer" (cf. C# code above), rather than referencing the existing instance like this:FeatureLayer fs = MyMap.Layers["MyMeters"] as FeatureLayer;
I have tried other options like:1. Removing the entire MyMap.Layers["MyMeters"] and inserting a new one (in the same index position as that of the previous one) with the new features.2. Creating a new graphics layers and add this one to the MyMap.Layers collection.These two options work fine, BUT my feature data grid gets all crazy: in option 1 the feature data grid references the feature layer that is removed. When I bind the new layer at run-time to it, it does not sync that well. In option 2, the feature data grid does not respond at all.Perhaps I am managing the features of a feature layer the wrong way. I think there may be a way to just "hide" or remove previous features from screen, so I can only see on screen the new ones. In doing, so I can choose to display only the features I specify, without having to "delete" them form the Service, or without having to "remove/insert" feature layers.Do you know any better way? Please share it with me.Hugo.