2

I'm using IFeatureSelection.SelectFeatures() to select parcel polygons in my parcel layer.

It works fine until I create a ClassBreaksRenderer to apply a color ramp based on a field in the feature.

The selection proceeds without error but does not draw on top of the renderer.

Is there a way to ensure that the feature selection draws on top?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Nov 8, 2011 at 16:10

2 Answers 2

1

Try calling IActiveView.PartialRefresh, passing in the esriViewGeoSelection draw phase -- once before, and once after selecting the features.

answered Nov 9, 2011 at 5:39
1
  • I can select an area correctly and then apply the renderer and the area remains selected. In addition I have discovered that the only the UniqueRenderer completely prevents the selection. The ClassBreaksRenderer works correctly (with the PartialRefresh) for some of the selection - but not all! For example: in one case the SelectionSet said that the SelectFeatures() query returned 11 and the map only selected 8! Commented Nov 9, 2011 at 17:15
1

One way to do it is to is with IScreenDisplay.Invalidate, see code here.

answered Nov 9, 2011 at 12:36
5
  • Tried this also and it failed. Could this be a real bug? The fact that it works randomly is disturbing? Does anyone know how to track the ArcGIS bugs - is there a site where they are listed? Commented Nov 10, 2011 at 15:34
  • @chaz I've seen random draw bugs in situations where there's an exception after IDisplay.StartDrawing but before IDisplay.FinishDrawing is called. In this situation the screen caches get into an unstable state I wonder if somehow the renderer has an unhandled exception internally. Are you using a custom renderer anywhere? Commented Nov 10, 2011 at 16:46
  • No custom renderer, just classbreaks and unique but I have been curious about the "NullReferenceExceptions" I see in the output window while I'm running the program - but this happens with no renderers defined. (And I have tried to track down everything that needed to be released.) Commented Nov 10, 2011 at 19:26
  • Have you run in debug mode after setting Debug>Exceptions> and check CLR and C++ for thrown exceptions? Commented Nov 10, 2011 at 19:52
  • Thanks! Found out was was causing the null reference exception (Enabled is called without class instantiation?) But I still can't do a select on top of a classified layer. Commented Nov 10, 2011 at 21:18

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.