Customize the Drop Down Items
This article shows how to customize the drop down items appearance and the drop down size.
ItemTemplate and ItemTemplateSelector
The UI of the items shown in the drop down list can be customized via the ItemTemplate and ItemTemplateSelector properties of RadAutoSuggestBox.
The ItemTemplate allows you to define a DataTemplate with any UIElements, which will be applied for each item from the ItemsSource of RadAutoSuggestBox.
Example 1: Setting ItemTemplate
Figure 1: Custom ItemTemplate
The ItemTemplateSelector allows you to choose a different DataTemplate for each item in the ItemsSource, based on a condition.
Example 2: Implementing the template selector
Example 3: Setting ItemTemplateSelector
Figure 2: Custom ItemTemplateSelector
The following example shows how to setup a basic RadAutoSuggestBox in order to test the ItemTemplate features.
Example 4: Creating data model for the items
Example 5: Populating the control with data
Drop Down Settings
The RadAutoSuggestBox control provides few properties to change the drop down default sizes - MaxDropDownHeight, MaxDropDownWidth and MinDropDownWidth.
Example 6: Setting drop down sizes
Figure 3: Custom drop down sizes
Additionally, you can manually open or close the drop down via the IsDropDownOpen property of RadAutoSuggestBox.