2

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?

asked Jul 11, 2012 at 15:34

1 Answer 1

3

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.

answered Jul 11, 2012 at 15:50
2
  • Thank you for your answer and your good questions. I am in ArcMap. The query is being done via a database connection (OleDbConnection), rather than using IEditor. I would fix it to use IEditor but it would involve a lot of rewiring. I will try your proposed solution. Commented Jul 11, 2012 at 16:06
  • SelectionChanged didn't work for me. What I ultimately did was call Refresh on the SelectionSet object. I'm accepting your answer because it got me on track to a solution. Commented Jul 11, 2012 at 20:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.