<?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: Right-click context menu and feature selection in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630289#M13023</link>
    <description>&lt;P&gt;Hi Roger,&lt;/P&gt;&lt;P&gt;This can be done via the ContextMenuDataContext property as described in the pro-sdk wiki:&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#adding-commands-to-the-context-menu" target="_self"&gt;adding-commands-to-the-context-menu&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Essentially, you can get the right-click location by casting&amp;nbsp;ContextMenuDataContext to a windows point.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;//get the screen location of the right click
  var cmdc = (System.Windows.Point)FrameworkApplication.ContextMenuDataContext;&lt;/LI-CODE&gt;&lt;P&gt;You can then cast to a map point to do useful things such as searching etc.&lt;/P&gt;&lt;P&gt;As an example, this is used in the &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Editing/ReplaceSketch/ReplaceSketch.cs" target="_self"&gt;replace sketch editing sample&lt;/A&gt; where the user replaces the current sketch with a feature that is right-clicked on. (the button is inserted in the daml of course)&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jul 2025 03:32:04 GMT</pubDate>
    <dc:creator>sjones_esriau</dc:creator>
    <dc:date>2025-07-04T03:32:04Z</dc:date>
    <item>
      <title>Right-click context menu and feature selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630082#M13022</link>
      <description>&lt;P&gt;Working through &lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-i-create-a-custom-context-menu-for-right/td-p/1293574" target="_self"&gt;this answer to someone else's question&lt;/A&gt; on the context menu, I've added a number of new buttons to the map's right-click context menu that do various, not feature specific, things like zooming in or out of the extent.&lt;/P&gt;&lt;P&gt;Now I'd like to add a tool that needs to know the feature that is located where the right-click took place, but have no idea how to do that. I'd like to add a button to the context menu that will display data related to the feature at the point the user right clicked.&lt;/P&gt;&lt;P&gt;Below is the code added to config.daml to update the context menu:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;updateModule refID="esri_mapping"&amp;gt;
  &amp;lt;menus&amp;gt;
    &amp;lt;updateMenu refID="esri_mapping_popupToolContextMenu"&amp;gt;
      &amp;lt;insertButton refID="FNSBArcGISProAddin_ParcelSelectRC" insert="before" placeWith="esri_mapping_cameraPropertiesControl" /&amp;gt;
      &amp;lt;insertButton refID="FNSBArcGISProAddin_ZoomInFixed" insert="before" placeWith="esri_mapping_cameraPropertiesControl" /&amp;gt;
      &amp;lt;insertButton refID="FNSBArcGISProAddin_ZoomOutFixed" insert="before" placeWith="esri_mapping_cameraPropertiesControl" /&amp;gt;
      &amp;lt;insertButton refID="FNSBArcGISProAddin_FullExtent" insert="before" placeWith="esri_mapping_cameraPropertiesControl" /&amp;gt;
    &amp;lt;/updateMenu&amp;gt;
  &amp;lt;/menus&amp;gt;
&amp;lt;/updateModule&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Unfortunately, for the class behind FNSBArcGISProAddin_ParcelSelectRC, I do not know how to capture the information for the right click location.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jul 2025 18:33:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630082#M13022</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2025-07-03T18:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Right-click context menu and feature selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630289#M13023</link>
      <description>&lt;P&gt;Hi Roger,&lt;/P&gt;&lt;P&gt;This can be done via the ContextMenuDataContext property as described in the pro-sdk wiki:&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#adding-commands-to-the-context-menu" target="_self"&gt;adding-commands-to-the-context-menu&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Essentially, you can get the right-click location by casting&amp;nbsp;ContextMenuDataContext to a windows point.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;//get the screen location of the right click
  var cmdc = (System.Windows.Point)FrameworkApplication.ContextMenuDataContext;&lt;/LI-CODE&gt;&lt;P&gt;You can then cast to a map point to do useful things such as searching etc.&lt;/P&gt;&lt;P&gt;As an example, this is used in the &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Editing/ReplaceSketch/ReplaceSketch.cs" target="_self"&gt;replace sketch editing sample&lt;/A&gt; where the user replaces the current sketch with a feature that is right-clicked on. (the button is inserted in the daml of course)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jul 2025 03:32:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630289#M13023</guid>
      <dc:creator>sjones_esriau</dc:creator>
      <dc:date>2025-07-04T03:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Right-click context menu and feature selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630891#M13027</link>
      <description>&lt;P&gt;Thanks much! Not sure how I missed that part of the wiki. I was able to quickly get this working once I had a look.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2025 22:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/right-click-context-menu-and-feature-selection/m-p/1630891#M13027</guid>
      <dc:creator>RogerAsbury</dc:creator>
      <dc:date>2025-07-07T22:25:22Z</dc:date>
    </item>
  </channel>
</rss>

