Pro 2.7
I'm looking to add new context menus when a user right clicks on a selected feature in the Attributes pane.
The Pro SDK Developer sample, InsertIntoContextMenu, is where I started but I'm getting stuck figuring out the RefID for the objects in the attribute pane.
I've searched the Editing.DAML but I'm not entirely sure what to look for.
I'm working with the Utility Network so the selected features could be either Spatial (red arrow) or Non-spatial (purple arrow) objects.
Any help on how to find the appropriate RefIDs would be greatly appreciated.
Thanks,
Mike
If you check the "show command IDs" in the Options dialog...
... Pro should display the ID of the contextmenu items when you hover on them.
Unfortunately it doesn't seem to tell you the contextmenu IDs (I wish it did).
I think you'll be updating esri_mapping_layerContextMenu or
esri_mapping_standaloneTableContextMenu (for non-spatial).
Hi Kirk,
I completely agree that the IDs of Context Menus should be displayed when hovering over them.
To find the correct Context Menus, here were my steps.
I found 3 instances where the new context menu item will be useful
1. esri_editing_Attributes_RelatedNonFeatureRowContextMenu
2. esri_editing_Attributes_NonFeatureRowContextMenu
3. esri_editing_Attributes_TableContextMenu
I'll be upadating my Config.daml file later today. Hopefully, this works!
@MichaelHirschheimer can u tell me how u added the menu in the context menu of the attribute pane when clicking on the feature?
Look at the Pro SDK developer sample, InsertIntoContextMenu. Specifically, the config.daml file.
https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/InsertIntoContextMenu
To add a custom button to the attribute pane, you'll need to update an existing menu in the module, esri_editing_EditingModule. Here's an example. Hope this helps!
<updateModule refID="esri_editing_EditingModule">
<menus>
<!-- Drill down from the spatial feature to the Non Spatial object for the Context Menu Item to appear -->
<updateMenu refID="esri_editing_Attributes_RelatedNonFeatureRowContextMenu">
<insertButton refID="InsertIntoContextMenu_Button1" separator="true" placeWith="esri_editing_Attributes_StandaloneTablePropertiesContextMenuItem" />
</updateMenu>
<!-- 2 Step Process: 1. The Non Spatial object must be checked in the Attribute Editor
2. A new entry is added at bottom of the Attribute Tree.
Right Click on that entry for the Context Menu Item to appear -->
<updateMenu refID="esri_editing_Attributes_NonFeatureRowContextMenu">
<insertButton refID="InsertIntoContextMenu_Button2" separator="true" placeWith="esri_editing_Attributes_StandaloneTablePropertiesContextMenuItem" />
</updateMenu>
<updateMenu refID="esri_editing_Attributes_FeatureContextMenu">
<insertButton refID="InsertIntoContextMenu_Button3" separator="true" placeWith="esri_editing_Attributes_LayerPropertiesContextMenuItem" />
</updateMenu>
</menus>
</updateModule>
Ya I also got the solution. But in your case are u accessing the name of the feature when right clicking on it. Because when I am right clicking on it I want to check for specific feature and then only want to show the menu item. I am able to access the attribute dock pane but not able to get the selection items since it is in private attribute view model class.
var pane = FrameworkApplication.DockPaneManager.Find("esri_editing_AttributesDockPane");
var viewModel = pane as ArcGIS.Desktop.Editing.Attributes.AttributesViewModel; //Error
@newbiedotnetguy If I'm understanding this correctly, you are looking for similar functionality described in this thread:
If the answer is yes, I can get a status update on the enhancement request from that thread.
yes its the same.