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

ItemTemplate and ClickToOpen

3 Answers 92 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Caesar
Top achievements
Rank 1
Caesar asked on 15 Sep 2009, 01:19 PM
Hello!

We want to use ClickToOpen on the root level of a menu.
At the same time we are using an ItemTemplate for the root level.

This combination doesn't work at all. Nothing happens when clicking the menu-item.
When looking at the source code it is obvious that it doesn't work since no a-tag is generated if it is templated.

Will this be fixed? And is there a workaround to get this to work until it is fixed?

Regards
Rikard

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Sep 2009, 02:56 PM
Hi Caesar,

You can try the following as a workaround:

        <telerik:RadMenu runat="server" ClickToOpen="true">
            <Items>
                <telerik:RadMenuItem>
                    <ItemTemplate>
                        <a class="rmLink"><span class="rmText">This is the root item</span></a>
                    </ItemTemplate>
                    <Items>
                        <telerik:RadMenuItem Text="Item 1"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Item 2"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Item 3"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Item 4"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Item 5"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenu>

Regards,
Albert,
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
Tan PS
Top achievements
Rank 1
answered on 22 Feb 2012, 01:03 PM
Dear Atanas,

From your solution provided above to enable ClickToOpen works in RadMenu with ItemTemplate. Then how can we apply the same to RadMenu with ItemTemplate created from code-behind? See sample from this link - checkbox within RadMenu?

Can you please provide a solution for RadMenu with ItemTemplate created from Code-Behind?

Thanks in advanced,
PS

0
Tan PS
Top achievements
Rank 1
answered on 22 Feb 2012, 05:39 PM
Dear all, I found a solution, just add HyperLink & span control at the root node from Code-Behind solved the issue.

Cheers,
PS
Tags
Menu
Asked by
Caesar
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Tan PS
Top achievements
Rank 1
Share this question
or