This is a migrated thread and some comments may be shown as answers.

RadContextMenu

3 Answers 95 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Ahrensberg
Top achievements
Rank 1
Ahrensberg asked on 23 Nov 2009, 09:12 PM
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


3 Answers, 1 is accepted

Sort by
0
Ahrensberg
Top achievements
Rank 1
answered on 24 Nov 2009, 09:05 AM
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'.
0
Yana
Telerik team
answered on 24 Nov 2009, 03:00 PM
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.
0
Ahrensberg
Top achievements
Rank 1
answered on 24 Nov 2009, 07:03 PM
Hi Yana.

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

BR Kenneth
Tags
Menu
Asked by
Ahrensberg
Top achievements
Rank 1
Answers by
Ahrensberg
Top achievements
Rank 1
Yana
Telerik team
Share this question
or