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?
2 Answers 2
Try calling IActiveView.PartialRefresh
, passing in the esriViewGeoSelection
draw phase -- once before, and once after selecting the features.
-
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!Chaz– Chaz2011年11月09日 17:15:04 +00:00Commented Nov 9, 2011 at 17:15
One way to do it is to is with IScreenDisplay.Invalidate, see code here.
-
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?Chaz– Chaz2011年11月10日 15:34:21 +00:00Commented 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?Kirk Kuykendall– Kirk Kuykendall2011年11月10日 16:46:26 +00:00Commented 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.)Chaz– Chaz2011年11月10日 19:26:01 +00:00Commented Nov 10, 2011 at 19:26
-
Have you run in debug mode after setting Debug>Exceptions> and check CLR and C++ for thrown exceptions?Kirk Kuykendall– Kirk Kuykendall2011年11月10日 19:52:13 +00:00Commented 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.Chaz– Chaz2011年11月10日 21:18:16 +00:00Commented Nov 10, 2011 at 21:18
Explore related questions
See similar questions with these tags.