RadMenu as context menu in hierarchical RadGrid

Thread is closed for posting
5 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 07 Nov 2006 Link to this post


    RadControls version

    RadGrid, RadMenu, RadAjax
    Telerik.Web.UI 2007.312.18+

    .NET version


    Visual Studio version


    programming language

    CS, Javascript

    browser support

    all browsers supported by RadControls 

    This example extends the online example of RadMenu as context menu in RadGrid  for hierarchical table structure. The extra part is to store the id of the clicked table in another hidden field on the page. Then you can pass this id server-side (to determine the GridTableView instance which has been clicked by the user) and perform the designated operation for the chosen grid row.

    Note that the actual update operation is not implemented but the demo can be extended to support updates in the same way as in the online demo with flat grid linked above.
  2. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 07 Nov 2006 Link to this post

    Additionally, if you want to display different context menus for each table in the hierarchy, you can set the Name property of each GridTableView and then extract the Name value inside the OnRowContextMenu handler.
    Then, depending on the value extracted in the handler, you can invoke the show client method of the relevant menu instance to render it as context menu.

    In the attached modified version of the application the context menus differ only by their Skin property value, however you can visualize completely distinctive menus by extending the demo implementation.
  3. Sebastian
    Sebastian avatar
    9934 posts

    Posted 13 Nov 2006 Link to this post

    That is not all guys,

    You can also enable multi-row selection and editing in the grid and perform an action (choosing item from the context menu) for all selected rows simultaneously.
    In the project attached to this message the available options from the context menu are Edit, Delete or Reset. The edit or delete command will be executed for all highlighted rows in the grid (having client multi-row selection enabled). The reset command will refresh the grid data and will clear the edit indexes/sort/group expressions.
    The technique for saving indexes for the selected rows is pretty much the same as the one presented in this online demo of the product (parsing hidden field content on the server).

    Note that the real delete is not implemented but you can extend the example to include it as well.

    Best regards,
    the telerik team
  4. ramesh s
    ramesh s avatar
    7 posts
    Member since:
    May 2006

    Posted 15 Oct 2007 Link to this post

        I have a scenarion which u have shown in 037328_PerformActionForAllSelectedRowsWithContextMenu.zip example but it is not working in the same way in 2007 Q1 version can somebody help me.
  5. Sebastian
    Sebastian avatar
    9934 posts

    Posted 17 Oct 2007 Link to this post

    Hi ramesh s,

    I have updated the example to use the latest version of our controls (RadGrid 5.0.1 and RadMenu 4.4.1). Refer to the new entry attached to the previous post for a demo version using the Prometheus counterparts of RadGrid, RadMenu and RadAjax.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.