[Menu] Right Click Support

2 posts, 0 answers
  1. Jason
    Jason avatar
    9 posts
    Member since:
    Jul 2008

    Posted 14 May 2009 Link to this post

    As I understand it, if I want to use the context menus with a right click I need to set the silverlight control to Windowless. By selecting windowless I understand this comes with the following negative side effects: (1) narrower range of browsers that can support my windowless silverlight control and (2) "substantial" performance degradation.

    Can you:
    1. Quantify "substantial" degradation? 10%, 50%, 99%?
    2. Are there any best practices when using context menus that can mitigate the performance hit? For instance, I noticed a Silverlight Datagrid sample that sets up a seperate context menu for EVERY item bound to a data bound control. If I remember correctly, I got better performance in your AJAX controls if I had ONE instance of the context menu and rebuilt it in javascript everytime the menu opened. I am wondering if a similar pattern could be implemented with the context menu in silverlight and more importantly if that results in noteworthy performance gains?
    3. Are there any anticipated/upcomming ways to solve negative side effects of right click context menus?

    Much thanks,
    Jason
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 16 May 2009 Link to this post

    Hello Jason,

    Straight to the answers:
    1) According to Microsoft, you will get drastic performance degradation when you set Windowless=true. However, in my opinion it all depends on your application - I did a quick test with our online demos and I did not find any perceptive difference. If you add the EnableFrameRateCounter=true parameter on the Silverlight object, you will be able to see the current frame rate of your application in the browser status bar (only IE is supported, though). I suppose that the effect of the Windowless parameter will be more visible in heavily animated applications or applications that play HD video.

    2) Creating a separate context menu for each gridview item is the easiest approach, in terms of programming, e.g. finding the associated gridview item on context menu click, etc. You can use a single context menu for the whole gridview, but you will have to manually determine which was the clicked gridview item. The RadContextMenu First Look example demonstrates how to do this with RadTreeView. I didn't tried it with RadGridView, but I think that the code will be virtually the same.

    3) When Microsoft adds native right click support in Silverlight we will no longer need to create javascript hacks to provide it, hence you will not need to use windowless mode to use it. Hopefully, Silverlight 4 will contain basic features such as mouse wheel and right click support. Until then, the right click and mouse wheel support will bring some negative effects. By the way, you could use left click + modifier key to open the context menu, but this is not very intuitive for the windows users.

    All the best,
    Valeri Hristov
    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