RadContextMenu

4 posts, 0 answers
  1. Ahrensberg
    Ahrensberg avatar
    73 posts
    Member since:
    Mar 2009

    Posted 23 Nov 2009 Link to this post

    I have made my own rightclick menu for selecting which headers has to be shown and which doesn't. I have done this by code above:

    <telerik:RadContextMenu ID="RadGrid1ContextMenu" runat="server" 
        OnClientItemClicked="RadGrid1ContextMenu_ClientItemClicked"
        <Targets> 
            <telerik:ContextMenuControlTarget ControlID="RadGrid1" /> 
        </Targets> 
        <Items> 
            <telerik:RadMenuItem Text="Status" Value="Status" 
                ImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box-uncheck.png" 
                SelectedImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box.png" Selected="true" /> 
            <telerik:RadMenuItem Text="Username" Value="UserName" 
                ImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box-uncheck.png" 
                SelectedImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box.png" Selected="true" /> 
            <telerik:RadMenuItem Text="Firstname" Value="FirstName"
                ImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box-uncheck.png" 
                SelectedImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box.png" /> 
            <telerik:RadMenuItem Text="Lastname" Value="LastName" 
                ImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box-uncheck.png" 
                SelectedImageUrl="App_Themes/Default/Graphics/Icons/ui-check-box.png" /> 
        </Items> 
    </telerik:RadContextMenu> 

    I get my menu as expected but my problem is then that it not is possible to select more than one item. When I select an item, all other items are getting deselected.

    I'm aware that the exist an EnableHeaderContextMenu for the grid, but I'm not interested in the sorting and grouping functionality in this menu (sorting should only be done by click at the header), and I want to execute some serverside code, when select and deselecting columns - and not letting the grid do the column-hiding.

    Best regards,
    Kenneth


  2. Ahrensberg
    Ahrensberg avatar
    73 posts
    Member since:
    Mar 2009

    Posted 24 Nov 2009 Link to this post

    For now I solved the problem by storing info about header choice outside my radmenu, and not used 'SelectedImageUrl', but instead changing the url in 'ImageUrl'.
  3. Yana
    Admin
    Yana avatar
    4888 posts

    Posted 24 Nov 2009 Link to this post

    Hello Ahrensberg,

    RadMenu doesn't support multiple selection so I think your solution is suitable for the situation.

    Regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  4. Ahrensberg
    Ahrensberg avatar
    73 posts
    Member since:
    Mar 2009

    Posted 24 Nov 2009 Link to this post

    Hi Yana.

    Okay, thanks for your answer, then I will keep my current solution.

    BR Kenneth
Back to Top