Introducing the New WinUI 3 ComboBox | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (15)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (67)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (920)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (37)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (151)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (41)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Introducing the New WinUI 3 ComboBox

Introducing the New WinUI 3 ComboBox

A combo box control is a dropdown control that allows you to type a value in a text box and choose from a list of predefined options.

We at Syncfusion have also developed a ComboBox control for the WinUI 3 platform for our 2021 Volume 3 release.

Following are the main features of the WinUI ComboBox in its initial release:

Let’s look at these features and learn how to integrate the new WinUI ComboBox control into your application.

Editing

The WinUI ComboBox supports both editable and non-editable text boxes for selecting an item from a data source.

In the editable mode, we can type and select the items from a collection. In this case, the typed item will get highlighted in a collection.

WinUI ComboBox in Editable Mode
WinUI ComboBox in Editable Mode

The non- editable mode prevents users from editing and instead allows them to select from the dropdown list.

ComboBox in Non- Editable Mode
ComboBox in Non- Editable Mode

Note: For more details, refer to the Editing in WinUI ComboBox documentation.

Multiselection

The ComboBox supports both single and multiple selection modes. The multiselection mode allows users to select multiple values from the dropdown list, whereas the single selection mode allows selecting only a single item. Multiple selection can be represented with checkboxes, like in the following screenshot.

MultiSelect ComboBox
MultiSelect ComboBox

Note: For more details, refer to the Multiple selections in WinUI ComboBox documentation.

Searching

Search for and select a required item from the list. You can search with either the starting or contained letters.

Searching in WinUI ComboBox
Searching in WinUI ComboBox

Note: For more details, refer to the Searching in WinUI ComboBox documentation.

Filtering

The ComboBox has built-in support to filter data items depending on the text entered in the editing text box. You can filter data by entering the starting letter or a specific letter in the item.

Refer to the following GIF images.

Filtering with Starting Letters in WinUI ComboBox
Filtering with Starting Letters in WinUI ComboBox
Filtering with Contained Letters in WinUI ComboBox
Filtering with Contained Letters in WinUI ComboBox

Note: For more details, refer to the Filtering in WinUI ComboBox documentation.

Grouping

You can group a collection and display the header for each group. Also, you can customize the group header with images and templates like in the following screenshot.

WinUI ComboBox with Grouped Items
WinUI ComboBox with Grouped Items

To display grouped collections, use the CollectionViewSource property. You can’t perform filtering while grouping a collection in the ComboBox control.

Note: For more details, refer to the Grouping in WinUI ComboBox documentation.

Selection box UI

You can easily customize the selection box appearance based on the selected item(s).

For example, you can display a country name with its flag or the selected iems count like in the following screenshot.

WinUI ComboBox with Customized Selection Box UI
WinUI ComboBox with Customized Selection Box UI

Note: Refer to the Selection box UI documentation for more details.

Item customization

You can easily customize the dropdown list items with images or any other custom control.

Items Customization in WinUI ComboBox
Items Customization in WinUI ComboBox

Note: To get detailed information, refer to the Customize ComboBoxItem documentation.

Theming

The ComboBox control is available in both light and dark themes.

Theming Support in WinUI ComboBox
Theming Support in WinUI ComboBox

Note: Refer to the Themes for Syncfusion WinUI Controls documentation.

Getting started with the WinUI ComboBox

We have explored the features of the WinUI ComboBox control. Now, let’s see how to add it to your application and use its basic features.

Step 1: Create a WinUI application.

First, create a simple project using the instructions provided in the Create app with Windows App SDK documentation.

Step 2: Add the Syncfusion.Editor.WinUI NuGet package.

Then, install the latest Syncfusion.Editor.WinUI NuGet package in the application from nuget.org or from the installed location, C:\Program Files (x86)\Syncfusion\Essential Studio\WinUI\xx.x.x.xx\NuGetPackages.

Note: xx.x.x.xx denotes the version of the Syncfusion WinUI Editor package.

Refer to the following screenshot.

Add the Syncfusion.Editor.WinUI NuGet PackageStep 3: Add the namespace.

Now, include the editors namespace in your XAML file with the following code.

xmlns:editors="using:Syncfusion.UI.Xaml.Editors"

Step 4: Initialize the ComboBox.

Initialize the ComboBox control and add the items like in the following code example.

<editors:SfComboBox x:Name="sfComboBox"
                    Width="250"
 	<editors:SfComboBoxItem Content="Badminton"/>
       <editors:SfComboBoxItem Content="Cricket"/>
       <editors:SfComboBoxItem Content="Football"/>
       <editors:SfComboBoxItem Content="Golf"/>
       <editors:SfComboBoxItem Content="Hockey"/>
</editors:SfComboBox>

This code will create the ComboBox with its items like the following GIF image.

WinUI ComboBox with Items
WinUI ComboBox Displaying Items

GitHub reference

Get the demo project for the WinUI ComboBox control on GitHub.

Conclusion

I hope you enjoyed learning about the new Syncfusion WinUI ComboBox control and its features. This control is available in our 2021 Volume 3 release. Also, check out our Release Notes and What’s New pages to see all the available new updates in this release. Try them out and leave your feedback in the comments section below!

You can download and check out our demo app in the Microsoft Store.

For current customers, the new version is available for download from the License and Downloads page. If you are not yet a Syncfusion customer, you can try our 30-day free trial to check out our newest features.

You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Related blogs

Tags:

Share this post:

Comments (2)

Nice! I like the Grouping and Selection features.

Jegan Raj Muthu Raj
Jegan Raj Muthu Raj

Hi Mark, Thanks for your feedback.

Comments are closed.

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed