<?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 Re: Accessing TableControl from TableControlContent in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838380#M3680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great workaround! Thanks very much for the help, Wolfgang!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Sep 2020 21:13:13 GMT</pubDate>
    <dc:creator>AlexZlotin1</dc:creator>
    <dc:date>2020-09-01T21:13:13Z</dc:date>
    <item>
      <title>Accessing TableControl from TableControlContent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838378#M3678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another question about TableControl. I have implemented a custom Attribute Table dockable panel which works exactly like the out-of-the-box one in Pro. The user right-clicks a layer, chooses the option to display the attribute table and a new tab is added to the tab control in my dockable panel (or an existing tab is activated). Now I am trying to add a right-click context menu to each attribute table so the user can zoom to a feature or flash feature. The TableControl community sample describes how to do that. The problem is that in my case the content of each tab is defined via a DataTemplate and in my view model for each tab I have access only to TabControlContent, not TableControl itself. Without&amp;nbsp;&lt;SPAN&gt;TableControl I do not have access to the OID of the feature:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var oid = tableControl.GetObjectIdAsync(tableControl.ActiveRowIndex).Result;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have attached the relevant files here. I will gladly provide more detail if needed. Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2020 16:20:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838378#M3678</guid>
      <dc:creator>AlexZlotin1</dc:creator>
      <dc:date>2020-08-31T16:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing TableControl from TableControlContent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838379#M3679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct the TableControl, which provides the means to find the select row and the associated object id, is not accessible.&amp;nbsp; We will have to enhance the API in the future to&amp;nbsp;close that gap.&amp;nbsp; However, for the time being there is a workaround by searching through the visual elements in order to find the corresponding TableControl.&amp;nbsp; I attached my sample code, which is using your main components.&lt;/P&gt;&lt;P&gt;To get the sample to work you have to select any layer to be shown in the "Attribute table" dockpane in the TOC of the Contents dockpane:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="506125" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/506125_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;Then click the "Show Attribute Table" button on the Add-in tab:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="506132" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/506132_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Now you should be able to select a row on any table and zoom to the shape's envelope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to highlight how to find the TableControl visual element:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// get the Visual Tree root element from your user control's ViewModel:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;AttributeTableViewModel&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; DockPane
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;// this should be the visual tree root of our user control&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; visualTreeRoot &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Content&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// using the visual tree root from above we can now traverse the visual tree to find our 'TableControl'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tableControl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; VisualTreeRoot&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetChildOfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;TableControl&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tableControl &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;// use the table control&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// and the GetChildOfType&amp;lt;&amp;gt; extension to find a child element of given type in a visual tree&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; T GetChildOfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;T&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt; DependencyObject depObj&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;where&lt;/SPAN&gt; T &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; DependencyObject
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;depObj &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Windows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Media&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;VisualTreeHelper&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetChildrenCount&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;depObj&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; child &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Windows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Media&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;VisualTreeHelper&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetChild&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;depObj&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Diagnostics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Debug&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;child&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetType&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;child &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; T&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;?&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;?&lt;/SPAN&gt; GetChildOfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;T&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;child&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838379#M3679</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-12-12T10:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing TableControl from TableControlContent</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838380#M3680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great workaround! Thanks very much for the help, Wolfgang!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2020 21:13:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/accessing-tablecontrol-from-tablecontrolcontent/m-p/838380#M3680</guid>
      <dc:creator>AlexZlotin1</dc:creator>
      <dc:date>2020-09-01T21:13:13Z</dc:date>
    </item>
  </channel>
</rss>

