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
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:
<SPAN class="keyword token">public</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">RefreshOpenWindows</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> ITableWindow pTableWindow <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">TableWindowClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pTableWindow<SPAN class="punctuation token">.</SPAN>Application <SPAN class="operator token">=</SPAN> ArcMap<SPAN class="punctuation token">.</SPAN>Application<SPAN class="punctuation token">;</SPAN> ITableWindow3 pTableWindow3 <SPAN class="operator token">=</SPAN> pTableWindow <SPAN class="keyword token">as</SPAN> ITableWindow3<SPAN class="punctuation token">;</SPAN> ISet pTableSet <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SetClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pTableWindow3<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FindOpenTableWindows</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">out</SPAN> pTableSet<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pTableSet<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Reset</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> ITableWindow pTableWindowTemp <SPAN class="operator token">=</SPAN> pTableSet<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Next</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> ITableWindow<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">while</SPAN> <SPAN class="punctuation token">(</SPAN>pTableWindowTemp <SPAN class="operator token">!=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> pTableWindowTemp<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Refresh</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pTableWindowTemp <SPAN class="operator token">=</SPAN> pTableSet<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Next</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> ITableWindow<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Do you have a query filter on the layer by any chance?
>> But if I reorder the Table with the GUI Explain?
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.EditChanged() tableWindow.TableControl.RemoveAndReloadCache() tableWindow.TableControl.Redraw() tableWindow.Refresh() End If tableWindow = pSet.Next End While
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.TableControl.Redraw() tableWindow.Refresh() End If tableWindow = pSet.Next End While
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.