Okay, so Telerik makes a fabulous suite of tools which include the RadComboBox control. Now if we want to take our previous example of a list of people the combobox works very well for selecting a list of items as shown in the the example below.
Now there is nothing fancy going on here. We just took some simple code to populate a RadComboBox with a list of people.
Now what happens if I need something a little more complex? Like say I want to have the combobox display something like the following…
Selected Person #1
Selected Person #2
———– Line ———-
Unselected Person #1
Unselected Person #2
What more….what if I wanted the two lists to be totally separate data templates?! Fortunately, even though the RadComboBox doesn’t necessarily support this Telerik provides us with another control know as the RadDropDownButton. Now stay with me on this….. The RadDropDownButton will work for us because instead of constraining us with ListBoxItems is provides us with a DropDownContent area that we can pretty much load up with whatever content our heart desires! So let’s do a little ‘fanaggling’ with our code. To separate out the two lists … we’ll start in the model first…. just so you can see what the backend is doing ….
So now we need to change out control to be a set of listboxes wrapped in a RadDropDownButton control. This follows nearly the same format as my post on Caliburn.Micro . So if you have trouble following along then feel free to reference that post as a precursor to this one.
And if we look at the finished project then we can see that we have the functionality that we were looking for……
Pretty cool, if you need that non-standard UI implementation, that Telerik has provided a way to get it accomplished!
In case you need the project for reference you can download it below.. However, I am working with the 4.0 version of the 2011 Q1 SP1 so you may have some broken references depending on which version of Telerik you are using.