Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've written an add-in (VS2010, C#) that finds specific invalid feature layers in ArcMap and fixes them. After the layer is fixed, the red invalid symbol still appears in the TOC. An activeview.refresh doesn't take care of it. How does one programatically get that layer entry to appear as valid without manual intervention?

share|improve this question
What about ESRI.ArcGIS.ArcMapUI.IContentsView::Refresh(null)? – mkennedy Apr 30 '13 at 18:49
Yes, that's it. – Rob Apr 30 '13 at 19:42

I think you just need to refresh the Table of Contents. Try something like this:

IMxDocument pDoc = (IMxDocument)pApp.Document;

for (int i = 0; i < pDoc.ContentsViewCount; i++)
share|improve this answer
That does the trick. I tried to upvote your answer, but apparently I don't have the minimal number of points yet for it to be accepted. – Rob Apr 30 '13 at 19:42

Your Answer


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.