Thank you for contacting Telerik Support.
I am guessing that you are not directly adding items, instead you are assigning a DataSource
to the RadDropDownListElement
. If that is the case then this behavior is normal since the RadDropDownListElement
tries to cache the values whenever possible, that is why the items are in the Items
collection when the RibbonBarElement
is expanded. As a workaround you can use the DataSource
which you are assigning and iterate over it. For example if your DataSource
is a List of integers
you can cast the DataSource
property of the RadDropDownListElement
and iterate it.
The caching and reusing of the data also raises the matter with the selected item. One possible way to workaround this behavior is to subscribe to the SelectedIndexChanged
of the RadDropDownList
and in a variable or other more advanced caching method to save the last selected item if the selected index is not -1. This way even when the ribbon is collapsed you will know what your selected item is.
I am attaching a sample project which demonstrates this above described functionality.
If you have any further questions or queries, do not hesitate to contact us.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>