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

How to PrePend DataBound Items

1 Answer 55 Views
Menu
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 2
David asked on 02 Apr 2013, 05:38 PM
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)?

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 05 Apr 2013, 11:30 AM
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.

Greetings,
Kate
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.
Tags
Menu
Asked by
David
Top achievements
Rank 2
Answers by
Kate
Telerik team
Share this question
or