Skip to content

Commit f7d90c7

Browse files
Merge pull request #1234 from syncfusion-content/AllownullcomboBox
Added AllowNull property in WinUI SfComboBox.
2 parents 4da92b1 + 313a5e7 commit f7d90c7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

winui/ComboBox/Editing.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ comboBox.IsEditable = false;
6565

6666
![WinUI ComboBox choose item using keyboard](Editing_images/winui-combobox-non-edit-mode.gif)
6767

68+
## Setting Null Value in ComboBox
69+
70+
In editable mode, enable the `AllowNull` property by setting it to `true`. This allows the ComboBox to accept a null value when the selected item is cleared using the `Delete` or `Backspace` key. By default, this property is set to `false`.
71+
72+
{% tabs %}
73+
{% highlight XAML %}
74+
75+
<editors:SfComboBox x:Name="comboBox"
76+
Width="250"
77+
IsEditable="true"
78+
ItemsSource="{Binding SocialMedias}"
79+
DisplayMemberPath="Name"
80+
TextMemberPath="Name"
81+
AllowNull="true">
82+
</editors:SfComboBox>
83+
84+
{% endhighlight %}
85+
86+
{% highlight C# %}
87+
88+
comboBox.AllowNull = true;
89+
90+
{% endhighlight %}
91+
{% endtabs %}
6892

6993
## Open a drop-down programmatically
7094

0 commit comments

Comments
 (0)