Articles in this section

How to Customize the NoResultsFound Text in the WinUI SfComboBox?

In this article, we demonstrate how to set a custom value or template when the user enters invalid input in the WinUI ComboBox control. When the entered text or item does not match with any item in the suggestion list, SfComboBox displays a message indicating that no results were found. You can customize this message using the NoResultsFoundContent and NoResultsFoundTemplate properties.

No Result Found Content

The NoResultsFoundContent property allows you to customize the text displayed when no matching results are found. The following code sample shows how to set the NoResultsFoundContent in the SfComboBox control.

XAML:
 <editors:SfComboBox  Header="ComboBox with No Result Found Text" 
                      PlaceholderText="Search a country" 
                      Width="300"   
                      NoResultsFoundContent="Not Found"
                      IsFilteringEnabled="True"
                      IsEditable="True"
                      ItemsSource="{Binding Countries}">
 </editors:SfComboBox>

NoresultFoundContent.png

NoResultFoundTemplate

We can customize the appearance of the desired text to be displayed for indicating no results found by using the NoResultsFoundTemplate property. Let’s see the example for the NoResultsFoundTemplate.

XAML:
<editors:SfComboBox  Header="ComboBox with No Result Found Template" 
                     PlaceholderText="Search a country" 
                     Width="300"   
                     NoResultsFoundContent="Not Found"
                     IsFilteringEnabled="True"
                     IsEditable="True"
                     ItemsSource="{Binding Countries}">
    <editors:SfComboBox.NoResultsFoundTemplate>
        <DataTemplate>
            <TextBlock Text="Not Found" 
                Foreground="Red" 
                FontStyle="Italic" 
                FontSize="20"  />
        </DataTemplate>
    </editors:SfComboBox.NoResultsFoundTemplate>
</editors:SfComboBox>

NoResultFoundTemplate.png

Conclusion

I hope you enjoyed learning how to Customize the NoResultsFound text in the WinUI SfComboBox.
.

You can refer to our WinUI ComboBox feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

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, Support portal, 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)
Access denied
Access denied