New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI ComboBox Commands

ComboBox has the following commands:

  • SelectAllCommand (ICommand)—Selects all items from the source.

The SelectAll command can be used only when SelectionMode is Multiple. An exception will be thrown if the command is invoked in Single SelectionMode.

  • ClearSelectionCommand (ICommand)—Sets the selection to null. If Multiple SelectionMode is used, this command will clear all selected items. YOu can override the default behavior and create custom command.

The example below shows both cases, the default ClearSelectionCommand execution and custom ClearSelectionCommand implementation:

<HorizontalStackLayout Spacing="5"
                       Margin="0, 0, 0, 12">
    <Button Text="Default Clear Command"
            Command="{Binding Source={x:Reference comboBox}, Path=ClearSelectionCommand}" />
    <Button Text="Custom Clear Command"

<telerik:RadComboBox x:Name="comboBox"
                     Placeholder="Select City!"
                     WidthRequest="{OnPlatform MacCatalyst=300, WinUI=300}"
                     HorizontalOptions="{OnIdiom Default=Fill, Desktop=Start}"
                     ItemsSource="{Binding Items}"
class CustomClearSelectionCommand : ComboBoxClearSelectionCommand
    public override async void Execute(object parameter)
        bool executeDefault = await App.Current.MainPage.DisplayAlert("Command", "Execute command?", "Yes", "No");
        if (executeDefault)

private void ExecuteCustomCommanClicked(object sender, EventArgs e)
    this.comboBox.ClearSelectionCommand = new CustomClearSelectionCommand();

ComboBox ClearSelectionCommand

See Also

In this article