[GIS] ArcGIS: How to programmatically refresh selected features

arcobjectsc

Background: I have C#, ArcGIS command that 1. lists selected features, and 2. allows you to delete selected features from this list out of a geodatabase.

My problem: After I delete features, ArcGIS doesn't update the selected features list. When my program asks ArcGIS for the selected features, it gets back references to the features it already deleted. It shouldn't.

My Question: What should I do to tell ArcGIS to check the selected features list for non-existent features? Is there a "refresh" command that will do this, or do I have to reselect the features (excluding the deleted ones) programmatically?

Best Answer

Are you in ArcMap? How exactly are you deleting features from the geodatabase? When you use IEditor to do those edits, changes to selection when deleting features should propagate properly.

You might also try casting the Map to ISelectionEvents and calling SelectionChanged to notify of selection change.