How to PrePend DataBound Items

2 posts, 0 answers
  1. David Tessler
    David Tessler avatar
    23 posts
    Member since:
    Feb 2005

    Posted 02 Apr 2013 Link to this post

    I have a dynamic menu to which I want to add a static item. So I create my static menu item (has some html for layout, but also a User Control embedded in it all within an Item Template) and set AppendDataBoundItems="true". Excellent. It works.

    Unfortunately my static item is in Index Position=0. I get that the data items are "appended", but I would like to put my static item last (after all of the dynamic Items). I could do it in code-behind, but I wonder if you know of an easier way (without having to create controls)?

  2. Kate
    Kate avatar
    1898 posts

    Posted 05 Apr 2013 Link to this post

    Hello David,

    Currently we are not aware of an approach that can allow you to define the menu items in the markup and set them as last items. However, using code behind, as you mention and the OnDataBound server-side event you can easily add menu items on the last position on the RadMenu control. For further reference here is a very simple example how this can be implemented.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top