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 have written an ArcMap Addin (ArcMap 10.0) that allows a user to perform a join between an in-memory table and a feature class (feature layer) added to the TOC. I want the attribute table of the feature layer to automatically refresh after the join occurs if the user happens to have the attribute table visible when performing the join. This way the fields added to the table via the join will be visible to the user without having to close and reopen the Attribute Table.

The following function is what I have tried to refresh the Attribute Table, but it does not actually refresh the display.

Private Sub RefreshAttributeTable()
    Try
        Dim tableWindow As ITableWindow3 = New TableWindow
        tableWindow.ActiveTableWindow.Refresh()

        My.ArcMap.Document.ActiveView.Refresh()
    Catch ex As Exception

        Debug.WriteLine(String.Format("{0}; {1}", ex.Message, ex.StackTrace))

    End Try
End Sub

Can anyone help with this?

share|improve this question
add comment

1 Answer 1

Your code creates a new table window obj but does not set it to any existing table. You should pass a reference to the ITableWindow3 obj that you want to refresh into your sub. If you don't have the obj reference already then use ITableWindow3.FindOpenTableWindows method to get an ISet obj that you can then loop to find the desired window. I believe the tableWindow.ActiveTableWindow.Refresh() call will work once you have tableWindow set to an existing obj.

share|improve this answer
    
Did Rich's answer work? I'm trying ITableWindow3 tableWindow = new TableWindowClass(); tableWindow = (ITableWindow3)tableWindow.FindViaLayer((IFeatureLayer)outputLayer); tableWindow.ActiveTableWindow.Refresh(); and does not work. –  user19055 Nov 27 '13 at 18:50
    
I think it is best if you (user19055) ask a new question and post your code, then perhaps I can help. –  Rich Wawrzonek Nov 28 '13 at 1:48
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.