Select to view content in your preferred language

Refresh open Table in Arcamp

2592
14
09-15-2013 04:19 AM
UrsRichard
Emerging Contributor
I "stamp" a position with the GPS-Tool to the Log-File saved in a filegeodatabase. In the map and the table window I always like to show the actual Log-File. I can refresh the view but not the opened table window. I always have to close and open the table window. I tried to refresh the table but nothing seems to have the effect to reload the actual data from the underlying featureclass (log-file). How can refresh the table window?

Dim pCmdItem As ICommandItem
            Dim pUID As New UIDClass()
            pUID.Value = "{256176AD-0C33-406C-9ED8-9F7AC784A3E3}"
            pCmdItem = My.ArcMap.Application.Document.CommandBars.Find(pUID)
            pCmdItem.Execute()

            Dim tableWindow As ITableWindow3 = New TableWindow
            Dim pSet As ISet = Nothing
            tableWindow.Application = My.ArcMap.Application
            tableWindow.FindOpenTableWindows(pSet)
            pSet.Reset()
            tableWindow = pSet.Next
            While Not tableWindow Is Nothing
                If tableWindow.IsOpen Then                                  
                    tableWindow.TableControl.RemoveAndReloadCache()
                    tableWindow.Refresh()
                End If
                tableWindow = pSet.Next
            End While
0 Kudos
14 Replies
UrsRichard
Emerging Contributor
Do you have a query filter on the layer by any chance?


Good idea. But there are no query filters.
0 Kudos
DubravkoAntonic
Occasional Contributor
Can you check if the object tableWindow it self contains right data, but the content on the screen is not refreshed, for forcing to refresh HWND.
I had this problem once, and  left it as is, minor benefit for spending a lot of time to solve it.
0 Kudos
UrsRichard
Emerging Contributor
What do you mean by "forcing to refresh HWND"?
0 Kudos
DubravkoAntonic
Occasional Contributor
Idea was to use some WIN API to force redrawing the window by using HWND of window.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd145002(v=vs.85).aspx

B
ut I searched a bit through the ArcObjects and it seems to me that using ITabeWIndow you just redraw window but your problem is not the window object itself but data inside window.
Data object is presented through TableView, try to get to the ITableControl and call method RemoveAndReloadCache - Lose cache, so the table window is current with the underlying database.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ITableControl3_Interface...

ope this hint will be helpfull to you.

Regards, Dubravko
0 Kudos
JamesKennedy1
Occasional Contributor

I apologize for bumping an open thread (there are so many without answers in this forum, which is quite disappointing to me), but I am having the same problem.

When I insert a value into a Field within a FeatureClass or a Table of a Feature, it doesn't reflect visually.

How can I refresh my Attribute Table I have open, as shown in my picture, programmatically.

Thank you for the time.

EDIT

And now for my solution, however this will not directly solve the problem of targeting a specific table window:

        public void RefreshOpenWindows()
        {
            ITableWindow pTableWindow = new TableWindowClass();
            pTableWindow.Application = ArcMap.Application;
            ITableWindow3 pTableWindow3 = pTableWindow as ITableWindow3;
            ISet pTableSet = new SetClass();
            pTableWindow3.FindOpenTableWindows(out pTableSet);

            pTableSet.Reset();
            ITableWindow pTableWindowTemp = pTableSet.Next() as ITableWindow;

            while (pTableWindowTemp != null) {
                pTableWindowTemp.Refresh();
                pTableWindowTemp = pTableSet.Next() as ITableWindow;
            }
        }

0 Kudos