Placing static menu items in databound menu

3 posts, 0 answers
  1. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 30 Sep 2010 Link to this post

    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. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 30 Sep 2010 Link to this post

    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?

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 04 Oct 2010 Link to this post

    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.
Back to Top