Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I added a new custom tree to TOC which looks like this:

    IFeature ...
    IRow ...

made context menu using this sample and it shows up alright, but unfortunatelly its context menu commands are not doing anything. Here is onNodeMouseClick:

private void tvwSelected_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
    if (e.Button == MouseButtons.Right)
        m_contextItem = e.Node.Tag;

        UID menuID = new UIDClass();
        if (e.Node.Tag is IFeature)
            menuID.Value = "{d32ae970-abb8-4f02-a592-9181f1307ed9}";
        ICommandBar cmdBar = (ICommandBar)_application.Document.CommandBars.Find(menuID, false, false);
        cmdBar.Popup(0, 0);

and here is context menu:

public ContextMenuTest()
    AddItem("esriCore.FeatureFindContextMenuItems", 1); //flash
    AddItem("esriCore.FeatureFindContextMenuItems", 2); //zoom
    AddItem("esriCore.FeatureFindContextMenuItems", 3); //identify
    AddItem("esriCore.FeatureFindContextMenuItems", 6); //unselect

I believe the probblem could be that IFeature is not what these commands require, or the whole thing works in totaly different way. Any help would be appreciated.

share|improve this question
"added a custom tree" ... does that mean you've implemented a custom IContentsView? – Kirk Kuykendall Mar 25 '13 at 14:50
@Kirk Kuykendall Yes, I did implement IContentsView3 just like in that sample given above. – Sunder Mar 25 '13 at 22:59
Anything Esri wrote with "esriCore" in the progid was deprecated way back in version 8.3. In your context menu you need to return progID's of commands you have written that expect IContentsView.CurrentItem to be an IObjectClass or an IFeature. – Kirk Kuykendall Mar 25 '13 at 23:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.