Select to view content in your preferred language

context menu when Right-clicked the actual field values/cells in the bottom grid of Attribute Pane

291
1
02-25-2026 03:26 AM
Status: Under Consideration
Labels (3)
RavindraSingh
Frequent Contributor

Problem Statement:
In the Attribute Pane, when right-clicking on actual field values or cells within the bottom grid, the expected context menu option “Catalog Help…” is not visible. However, I am able to add this context button in the Top section of the Attribute Pane as well as in the Attribute Table.

RavindraSingh_0-1772018425672.png

here is the configuration I tried in the config.daml file:

<!-- The button is added to the context menu of the attribute table. It's working.-->
<updateMenu refID="esri_editing_tableCellContextMenu">
	<!-- Inserts the button with a separator at a specific place -->
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" />
</updateMenu>


<updateMenu refID="esri_editing_Attributes_RelatedNonFeatureRowContextMenu">
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" separator="true" placeWith="esri_editing_Attributes_StandaloneTablePropertiesContextMenuItem" />
</updateMenu>

<!-- 2. esri_editing_Attributes_NonFeatureRowContextMenu: is used for standalone table records that are open in the Attributes Pane but are not currently being viewed as a "related child" of a map feature.
     e.g. In ArcGIS Pro, when you open a standalone table (one without geometry) and select a row, that row appears in the Attributes Pane. This specific refID controls the right-click menu for that record's entry in the selection tree.-->
<updateMenu refID="esri_editing_Attributes_NonFeatureRowContextMenu">
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" separator="true" placeWith="esri_editing_Attributes_StandaloneTablePropertiesContextMenuItem" />
</updateMenu>

<updateMenu refID="esri_editing_Attributes_FeatureContextMenu">
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" separator="true" placeWith="esri_editing_Attributes_LayerPropertiesContextMenuItem" />
</updateMenu>

<!-- esri_editing_Attributes_FeatureRowContextMenu: Right-clicking a Map Feature (Point, Line, Poly) in the top selection tree. -->
<updateMenu refID="esri_editing_Attributes_FeatureRowContextMenu">
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" separator="true" />
</updateMenu>


<!-- esri_editing_AttributesPaneAttributesContextMenu: Right-clicking the actual field values/cells in the bottom grid. -->
<updateMenu refID="esri_editing_AttributesPaneAttributesContextMenu">
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" separator="true" />
</updateMenu>

<updateMenu refID="esri_editing_AttributesPane_GridContextMenu">
	<insertButton refID="POC_Addins_CustomContext_Views_CatalogHelpBtn" separator="true" />
</updateMenu>

 

here is the screen shot of the menu I am trying to add. And on that button, I want to get the current layer  / table and that feature's objectid/globalid as well.

The Reason Why I need this: I want to add a button that reacts to the specific field where the user has just right‑clicked. The goal is to detect which field was right‑clicked and then trigger an action based on that field. Different fields will have different actions associated with them. 
Similar thing I can get from the Attribute Table's custom Context menu button.

RavindraSingh_1-1772018523097.png

Here are some more details how at Attribute Table context Menu it gives:

Context Menu Button Click Handler on Attribute Table:

RavindraSingh_2-1772018640523.png

Below source code was implemented as a custom context menu button click handler. When a user right‑clicks within the Attribute Table of a Feature Class or Table, the handler retrieves the selected column name and the corresponding row’s ObjectID. The functionality is specifically designed to support a custom context menu button integrated but on the Attribute Table interface.

protected override async void OnClick()
{
    await QueuedTask.Run(async () =>
    {
        var tablePane = FrameworkApplication.Panes.ActivePane as ITablePane;
        if (tablePane == null) return;

        // Here I am getting the Currently Right clicked FieldName and the Row's objectID as well
        string fieldName = tablePane.ActiveColumn?.Name;
        long activeObjectId = (long)tablePane.ActiveObjectID;

        if (string.IsNullOrEmpty(fieldName)) return;

        var mapMember = tablePane.MapMember;
        if (mapMember == null) return;

        bool isEditable = false;
        string memberName = mapMember.Name;

        // Check for FeatureLayer
        if (mapMember is FeatureLayer fl)
        {
            isEditable = fl.IsEditable;
        }
        else if (mapMember is StandaloneTable st)
        {
            isEditable = st.IsEditable;
        }
        else
        {
            // Not a supported editable type
            System.Windows.Application.Current.Dispatcher.Invoke(() =>
            {
                ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(
                    $"The selected item '{memberName}' is not an editable layer or table.",
                    "Not Editable",
                    MessageBoxButton.OK,
                    MessageBoxImage.Warning);
            });
            return;
        }

        if (!isEditable)
        {
            System.Windows.Application.Current.Dispatcher.Invoke(() =>
            {
                ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(
                    $"Layer or table '{memberName}' is not editable. Please ensure it is editable before making changes.",
                    "Not Editable",
                    MessageBoxButton.OK,
                    MessageBoxImage.Warning);
            });
            return;
        }

        await ShowDialogAndUpdateRecord(mapMember, fieldName, activeObjectId);
    });
}

 

1 Comment
JMutunga
Status changed to: Under Consideration