ContextMenuStrip for Hierarchical Grid

2 posts, 1 answers
  1. Chung-Yuan
    Chung-Yuan avatar
    1 posts
    Member since:
    Dec 2011

    Posted 25 Jul 2013 Link to this post

    Hi,
    I can assign ContextMenuStrip to a radGridView. 
    Now I have a Hierarchical Grid, what should i do if i want to assign ContextMenuStripA to master and ContextMenuStripB to detail?  

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2907 posts

    Posted 30 Jul 2013 Link to this post

    Hi Chung-Yuan,

    Thank you for writing.

    Your question has already been answered in the other thread you've opened We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

    Hower I am copying the answer here so the community can benefit from it:

    You can use the ContextMenuOpening event like this:
    void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
    {
        GridDataCellElement cell = e.ContextMenuProvider as GridDataCellElement;
      
        GridViewRowInfo row = cell.RowInfo;
          
        if (row.HasChildRows())
        {
            e.ContextMenu = firstContextMenu.DropDown;
        }
        else
        {
            e.ContextMenu = secondContextMenu.DropDown;
        }
    }

    Also consider the following article where you can find complete information for how to display different context menus:Conditional Custom Context Menus

    Thank you for your understanding.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top