Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
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 Nov 9 '11 at 17:15
add comment

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

share|improve this answer
    
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 Nov 10 '11 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 Nov 10 '11 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 Nov 10 '11 at 19:26
    
Have you run in debug mode after setting Debug>Exceptions> and check CLR and C++ for thrown exceptions? –  Kirk Kuykendall Nov 10 '11 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 Nov 10 '11 at 21:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.