maybe this is an easy one for anybody (but not for me). I could find a lot of examples using the radDropDownButton but all of them do fill the drop down list through the .XAML file, not dynamically.
I tried several things like
<System.Windows.Controls.ListBoxItem> theItems=new List<System.Windows.Controls.ListBoxItem>();
// Fill List with several items...
but nothing worked correctly.
Does anybody know how to fill it so that when it drops down, it displays the contents?
Is there any documentation about how to use the Telerik Controls? It seems like there are only examples and class documentation, but no real manual like "How to use the ... control".
6 Answers, 1 is accepted
You need to set theDropDownButton DropDown content to a visual element. In your case you need to create a ListBox and fill it with ListBoxItems and then set the ListBox as DropDownContent:
Based on your feedback we will definitely update our online documentation to better illustrate such scenarios. More information about how to use our Silverlight controls you can find in the Step-by-Step tutorial here.
I hope that info will help you. Let us know if we can further assist you.
the Telerik team
Currently you're binding the Content of the RadDropDownButton to the SelectedItems Content of the ListBox, but your ListBox is not bound and its SelectedItem is of type ListBoxItem and the content is of type string, so you're binding the Content of the RadDropDownButton to string. The problem comes from the DropDownContentTemplate - in it you try to show InputUOM property, but your object is string and it doesn't have such property. The are two things you can do - remove the template like this:
or use business objects in your ListBox.
For further references could you please examine the attached project and if you have more questions feel free to ask.
the Telerik team
What is the alternate DisplayMemberPath & ValueMemberPath for RadDropDownButton control?
As the RadDropDownButton doesn't expose such properties, what I can suggest you is in the DropDownContent of the RadDropDownButton specify a RadListBox. You can bind the ItemsSource property of the list box to a collection from your view model and set the DisplayMemberPath property of the control.
I have created sample project which demonstrates this approach and attached it to this reply.
Thanks Dinko for your assistance. Also please help me on my another post as well.
Thanks in advance!