Mark, Thank you for your posting. We are currently looking into this problem. In the meantime you can have a variable to keep track of the selection count whenever there is a change in your feature layer graphics collection AND the selection in your layer. You should clear the selection when:1. There was no selection in your layer previously, AND2. Current selection count is equal to 1 Your code whould be something similar to the following code snippet:
int selectedCount; // Variable to keep track of the selection count in FeatureLayer
public YourUserControlClassConstructor()
{
InitializeComponent();
FeatureLayer featureLayer = MyMap.Layers["MyFeatureLayer"] asFeatureLayer;
featureLayer.Graphics.CollectionChanged += Graphics_CollectionChanged;
selectedCount = featureLayer.SelectionCount;
}
privatevoid Graphics_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (selectedCount == 0 /* No selections before */
&& MyDataGrid.SelectedItems.Count == 1 /* Unwanted selection after the change in graphics collection */)
MyDataGrid.SelectedItems.Clear();
selectedCount = MyDataGrid.SelectedItems.Count;
}
Hope this helps.