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

Placing static menu items in databound menu

2 Answers 54 Views
Menu
This is a migrated thread and some comments may be shown as answers.
msigman
Top achievements
Rank 2
msigman asked on 30 Sep 2010, 06:23 PM
I have a RadMenu which is successfully binding to my IQueryable collection.  However, I have several items that I'd like to ALWAYS appear on the menu, which are not in the datasource.  What is the best way to accomplish this?  Specifically, some of the items will require custom ItemTemplates.  I tried an approach like this without success.  When I would call DataBind(), it seems the control would ignore the hard coded items I'd added and only apply the databound items.

     <telerik:RadMenuItem runat="server"
             <Items><telerik:RadMenuItem>        
                        <ItemTemplate>
                             <ContentTemplate>
                                   My code here....
                                        </ContentTemplate>
                                 <
ItemTemplate>
                   
</Items>
      </telerik:RadMenuItem>

2 Answers, 1 is accepted

Sort by
0
msigman
Top achievements
Rank 2
answered on 30 Sep 2010, 06:28 PM
Wouldn't you know it, I spend a couple hours researching before I made this post, and immediately after making the post I found the answer. I need to set AppendDataBoundItems="true".

THE NEW QUESTION IS: How can I make my declared items appear AFTER the databound items, instead of before them?

0
Cori
Top achievements
Rank 2
answered on 04 Oct 2010, 03:45 PM
Hello Matthew,

If you want to have your databound items appear after the static ones, there is no way to do that declaratively. You'll have to do in the code-behind, by first making a call to the DataBind method of the RadMenu and then adding the static menu items.

I hope that helps.
Tags
Menu
Asked by
msigman
Top achievements
Rank 2
Answers by
msigman
Top achievements
Rank 2
Cori
Top achievements
Rank 2
Share this question
or