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'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
add comment

1 Answer

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++)
{
     pDoc.ContentsView[i].Refresh(null);
}
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
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.