Articles in this section
Category / Section

How to display leading and trailing view in WinUI ComboBox control?

4 mins read

This article explains how to display leading and trailing view in the Win UI ComboBox control.

The LeadingView appears before the ComboBox selection area, and the TrailingView appears after the ComboBox selection area. Any content, such as an icon, image, button, or control can be displayed in the LeadingView and TrailingView.

Leading View

The following code shows how to include the LeadingView in ComboBox.

XAML

<editors:SfComboBox Header="ComboBox with Leading View"
                        PlaceholderText="Search a country">
        <editors:SfComboBox.LeadingView>
               <Viewbox Height="16"
                        Width="16"
                        Margin="4,0,0,0">
                   <SymbolIcon Symbol="Find" />
               </Viewbox>
        </editors:SfComboBox.LeadingView>
</editors:SfComboBox>

ComboBox3.png

Trailing View

The following code shows how to include the TrailingView in the ComboBox.

XAML

<editors:SfComboBox Header="ComboBox with Trailing View"
                       PlaceholderText="Search a country">
       <editors:SfComboBox.TrailingView>
             <Button Style="{ThemeResource AlternateCloseButtonStyle}"
                     Height="30"
                     AllowFocusOnInteraction="False">
                   <Viewbox Height="16"
                            Width="16">
                       <FontIcon Glyph="" />
                   </Viewbox>
             </Button>
       </editors:SfComboBox.TrailingView>
</editors:SfComboBox>

ComboBox2.png

Leading and Trailing View

The following code shows how to include both LeadingView and TrailingView in the ComboBox.

XAML

<editors:SfComboBox Header="ComboBox with Leading and Trailing View"
                       PlaceholderText="Search a country">
       <editors:SfComboBox.LeadingView>
                   <editors:SfComboBox Margin="0,4,0,4">
                           <editors:SfComboBoxItem Content="Asia" />
                           <editors:SfComboBoxItem Content="Africa" />
                           <editors:SfComboBoxItem Content="North America"/>
                           <editors:SfComboBoxItem Content="South America" />
                           <editors:SfComboBoxItem Content="Europe" />
                           <editors:SfComboBoxItem Content="All Countries"
                                                   IsSelected="True"/>
                   </editors:SfComboBox>
       </editors:SfComboBox.LeadingView>
       <editors:SfComboBox.TrailingView>
                   <Viewbox Height="16"
                            Width="16"
                            Margin="0,0,8,0">
                       <SymbolIcon Symbol="Find" />
                   </Viewbox>
       </editors:SfComboBox.TrailingView>
</editors:SfComboBox>

ComboBox1.png

Conclusion
I hope you enjoyed learning about how to Display Leading and Trailing View in WinUI ComboBox Control.

You can refer to our WinUI ComboBox feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinUI ComboBox example to understand how to create and manipulate data.

For current customers, you can check out our components from the Licence and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forum, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied