<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Table Events? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149939#M3889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know of any events for when a table is opened within ArcMap? For example right clicking on a layer and choosing "Open Attribute Table" or right clicking on the root database path and adding a table then opening that table? I'd like to be able to change the read only, highlight and visible states of the fields within tables that are opened. I know how to change the display of the table I just can't find a way to trap for when a table is opened.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've found the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ITableViewEvents_Interface/00290000009n000000/"&gt;ITableViewEvents Interface&lt;/A&gt;&lt;SPAN&gt; but it doesn't provide any methods for notification that a table has been opened.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 May 2012 14:21:20 GMT</pubDate>
    <dc:creator>GregRieck</dc:creator>
    <dc:date>2012-05-09T14:21:20Z</dc:date>
    <item>
      <title>Table Events?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149939#M3889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know of any events for when a table is opened within ArcMap? For example right clicking on a layer and choosing "Open Attribute Table" or right clicking on the root database path and adding a table then opening that table? I'd like to be able to change the read only, highlight and visible states of the fields within tables that are opened. I know how to change the display of the table I just can't find a way to trap for when a table is opened.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've found the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ITableViewEvents_Interface/00290000009n000000/"&gt;ITableViewEvents Interface&lt;/A&gt;&lt;SPAN&gt; but it doesn't provide any methods for notification that a table has been opened.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;G&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 14:21:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149939#M3889</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2012-05-09T14:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Table Events?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149940#M3890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Interesting question this as I did not know of a solution to this. Things have been made more 'challenging' now that container window exists which holds all the tables. I've been thrashing around in ArcObjects and the best I could come up with is the following code that will wire up an event to a table &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;once&lt;/SPAN&gt;&lt;SPAN&gt; it has been opened. I'm hoping someone out there knows of a better solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public WithEvents pDataWindowEvents As TableWindow
Public pTableWindow As ITableWindow3

Public Sub TableWindowTest()

&lt;SPAN style="color:#008000;"&gt;' Create a TableWindow Object and add Application object to it
&lt;/SPAN&gt;Set pTableWindow = New TableWindow
Set pTableWindow.Application = Application

&lt;SPAN style="color:#008000;"&gt;' Get a handle on the open tables in TableWindow as a set object
&lt;/SPAN&gt;Dim s As ISet
pTableWindow.FindOpenTableWindows s
Debug.Print "number of tables open in TableWindow: " &amp;amp; s.Count
s.Reset
If s.Count = 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print "Window not open!"
Else
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:#008000;"&gt;' Get first table from set object
&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Dim pTW As ITableWindow
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTW = s.Next
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:#008000;"&gt;' Wire up event listener to this specific table
&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Set pDataWindowEvents = pTW
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:#008000;"&gt;' Get the Table object
&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Dim pTable As ITable
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTable = pTW.Table
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:#008000;"&gt;' Report some info in debug
&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Dim pDataset As IDataset
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pDataset = pTable
&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print "Returned Table: " &amp;amp; pDataset.Name
&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print "Number of rows:" &amp;amp; pTable.RowCount(Nothing)
End If
End Sub

Private Sub pDataWindowEvents_HideWindow(ByVal window As esriArcMapUI.IDataWindow)
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "goodbye!"
End Sub

Private Sub pDataWindowEvents_ShowWindow(ByVal window As esriArcMapUI.IDataWindow)
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "hello!"
End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:06:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149940#M3890</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T08:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table Events?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149941#M3891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Duncan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I already use that approach for other aspects of my solution. However, it doesn't answer the question. I couldn't find a way to be notified that a table had been opened either. I'll hold onto hope that someone out there has an answer. I'm wanting to be notified as the table is opened not when it's selected or by looping through already open tables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 14:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/table-events/m-p/149941#M3891</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2012-05-15T14:51:43Z</dc:date>
    </item>
  </channel>
</rss>

