RadGridView for WPF: Changing ContextMenu per Cell Clicked

5 posts, 0 answers
  1. Laura
    Laura avatar
    11 posts
    Member since:
    Jun 2009

    Posted 30 Jun 2009 Link to this post

    Hi,
    I want to be able to display a different context menu depending on which column cell the user right-clicks on as described on this article for the RadGridView for WinForms:
    http://www.telerik.com/support/kb/winforms/gridview/radgridview-custom-context-menu-dependent-on-element-clicked.aspx


    I need to be able to do the same in WPF. Is it possible?
    Thanks,
    Laura
  2. Allan
    Allan avatar
    24 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post

    I'm also interested in this....    
  3. UI for WPF is Visual Studio 2017 Ready
  4. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 03 Jul 2009 Link to this post

    Hello Laura and Allan,

    Please have a look at the attached sample project. It demonstrates a way to have different context menus for the first and the second column .

    Don't hesitate to ask if you find any troubles adapting this to your projects


    Best wishes,
    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Laura
    Laura avatar
    11 posts
    Member since:
    Jun 2009

    Posted 03 Jul 2009 Link to this post

    Hello,

    Thank you so much for the example. I would like to have this implemented using a StyleSelector, but I can't find the appropriate property that I should set; is it even possible?

    Thanks,
    Laura
  6. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 08 Jul 2009 Link to this post

    Hi Laura,
    Unfortunately GridViewCell, GridViewColumn and GridViewRow do not expose any properties of type StyleSelector.  So in short - such implementation will not be possible with the current version of RadGridView. However your request is very reasonable and I will elevate this to be included as an  API improvement for our future versions.

    Kind regards,

    Pavel Pavlov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for WPF is Visual Studio 2017 Ready