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; }
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.