New to Telerik UI for Xamarin? Download free 30-day trial

ComboBox Header and Footer

You can easily add Header and Footer to the Drop Down list of the ComboBox control through the following propertes:

  • HeaderTemplate(DataTemplate): Defines the template of the header that will be visualized in the drop down list.
  • FooterTemplate(DataTemplate): Defines the template of the footer that will be visualized in the drop down list.

It is not recommended to add controls in the Header and Footer which steal the focus (like Entry, editor, etc.) from the ComboBox control, as unexpected behavior may occur.


Here is the ComboBox definition in XAML:

<telerikInput:RadComboBox ItemsSource="{Binding Items}" 
                          Placeholder="Select which city you want to visit"
            <StackLayout BackgroundColor="LightBlue">
                <Label Text="To Visit List!" 
                <Button Text="Add Items" Clicked="Button_Clicked" BackgroundColor="LightBlue"/>

the sample business model

public class City
    public string Name { get; set; }
    public int Population { get; set; }

and the ViewModel used:

public class ViewModel : NotifyPropertyChangedBase
    public ViewModel()
        this.Items = new ObservableCollection<City>
            new City { Name = "Tokyo", Population = 13929286 },
            new City { Name = "New York", Population = 8623000 },
            new City { Name = "London", Population = 8908081 },
            new City { Name = "Madrid", Population = 3223334 },
            new City { Name = "Los Angeles", Population = 4000000},
            new City { Name = "Paris", Population = 2141000 },
            new City { Name = "Beijing", Population = 21540000 },
            new City { Name = "Singapore", Population = 5612000 },
            new City { Name = "New Delhi", Population = 18980000 },
            new City { Name = "Bangkok", Population = 8305218 },
            new City { Name = "Berlin", Population = 3748000 },

    public ObservableCollection<City> Items { get; set; }

This is how the Header and Footer Templates look:

ComboBox Header Footer Templates

Header and Footer Template example can be found in our SDK Browser Application. You can find the applications in the Examples folder of your local Telerik UI for Xamarin installation or in the following GitHub repo.

See Also

In this article