Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions winui/ComboBox/Searching.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,32 @@ The `ComboBox` control provides support to auto append the text based on data so

N> Auto appending of text is supported only in `Editable` mode and `TextSearchMode` property should be `StartsWith`.

## Diacritic aware search

The `IgnoreDiacritic` option allows string comparison and search operations to treat characters with diacritical marks as equivalent to their base characters. This is useful for search indexing, and user-friendly matching across languages. By default, Diacritic is not considered. Enable or disable the diacritic sensitivity using the `IgnoreDiacritic` property. The following code example demonstrates how to enable the diacritic sensitivity.

{% tabs %}
{% highlight xaml %}

<editors:SfComboBox x:Name="comboBox"
Width="250"
IsEditable="true"
ItemsSource="{Binding SocialMedias}"
TextMemberPath="Name"
DisplayMemberPath="Name"
IgnoreDiacritic = "false" />

{% endhighlight %}

{% highlight C# %}

comboBox.IgnoreDiacritic = "false";

{% endhighlight %}
{% endtabs %}

![WinUI ComboBox search the items based on Diacritic word/char in the edit field](Searching_images/winui-combobox-diacriticimage.png)

## Search Mode

The `TextSearchMode` property of the `ComboBox` can be used to regulate how the control behaves when it receives user input. The default text searching type is `StartsWith`, ignoring accent and it is case insensitive. The available text search modes are,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions winui/ComboBox/Selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,38 @@ private async void OnComboBoxSelectionChanged(object sender, ComboBoxSelectionC
{% endtabs %}

![WinUI ComboBox selection change notification](Selection_images/winui-combobox-selection-change-notification.png)

## Selection changing notification

The `SelectionChanging` event occurs before processing the selection. This is a cancelable event. This argument contains the following information:

* `AddedItems` - Contains the items that are being selected.
* `RemovedItems` - Contains the items that are being unselected.
* `AllowDetachedSelection` - Gets or sets a value indicating whether the not in list item should be displayed or not.
* `Cancel` - Gets or sets a value that indicates whether the selection should be canceled or not.

{% tabs %}

{% highlight xaml %}

<editors:SfComboBox x:Name="comboBox"
Width="250"
TextMemberPath="Name"
DisplayMemberPath="Name"
ItemsSource="{Binding SocialMedias}"
SelectionChanging="OnComboBoxSelectionChanging" />

{% endhighlight %}

{% highlight C# %}

comboBox.SelectionChanging += OnComboBoxSelectionChanging;

private void OnComboBoxSelectionChanging(object sender, Syncfusion.UI.Xaml.Editors.ComboBoxSelectionChangingEventArgs e)
{
e.AllowDetachedSelection = true;
}

{% endhighlight %}

{% endtabs %}