Hi Gary,
It is really weird, I cannot reproduce it in my test application, but it does happen in my production application. And yes, I am clearing excluded features before calling GetAllFeatures method.
And also I found that my code works fine with version 5.5.153, but does not work with version 5.5.171.0.
Do you know about any significant changes between versions?
This is my code I am using to filter features:
private void Filter()
{
FeatureLayer layer = wpfMap1.FindFeatureLayer("FeatureLayer");
if (layer == null) return;
lock (layer)
{
layer.Open();
layer.FeatureIdsToExclude.Clear();
Collection<Feature> allfeatures = layer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);
foreach (Feature f in allfeatures)
{
string name = GetFeaturesName(f);
if (!filteredFeatures.ContainsKey(name))
{
layer.FeatureIdsToExclude.Add(f.Id);
}
}
layer.Close();
overlay.Refresh();
}
}
Thank you for your help,
Inna