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

RadMenu in asp:Repeater

2 Answers 83 Views
Menu
This is a migrated thread and some comments may be shown as answers.
John Hadjioannou
Top achievements
Rank 1
John Hadjioannou asked on 24 Jul 2009, 07:18 AM
I'd like to use a RadMenu in a Repeater with the NavigateUrl properties set from fields in the current record, but I don't seem to be able to find a way of making it work - any help much appreciated.

John

(irrelevant code removed - there are other fields displayed withing the <td>)

 
<table>   
     <tr>   
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="FeatureSource">   
            <ItemTemplate>   
                <td>   
                                <telerik:RadMenu ID="RadMenu1" runat="server">   
                                    <Items>   
                                        <telerik:RadMenuItem runat="server" Text="map" NavigateUrl='<%#Eval("FeatureMapUrl")%>'>   
                                        </telerik:RadMenuItem>   
                                        <telerik:RadMenuItem runat="server" Text="what goes on" NavigateUrl='<%#Eval("FeatureListUrl")%>'>   
                                        </telerik:RadMenuItem>   
                                        <telerik:RadMenuItem runat="server" Text="diary" NavigateUrl='<%#Eval("FeatureDiaryUrl")%>'>   
                                        </telerik:RadMenuItem>   
                                    </Items>   
                                </telerik:RadMenu>   
                 </td>   
            </ItemTemplate>   
        </asp:Repeater>   
    </tr>   
 </table>   
 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 24 Jul 2009, 07:51 AM
Hello John Hadjioannou,

Unfortunately this is not supported. The menu items cannot evaluate the databinding expressions as they are child controls. I recommend you subscribe to the ItemDataBound event of your Repeater and populate the NavigateUrl from code.

Greetings,
Albert
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.
0
John Hadjioannou
Top achievements
Rank 1
answered on 24 Jul 2009, 09:29 AM
Thank you, I have done as you suggested and it now works.

John
Tags
Menu
Asked by
John Hadjioannou
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
John Hadjioannou
Top achievements
Rank 1
Share this question
or