Category / Section
How to display empty string in WinForms IntegerTextBox when databound value is null?
1 min read
Display empty string
We can display empty string when databound value is null. For this we need to bind the editor controls (like IntegerTextBox, DoubleTextBox, etc.,) to BindableValue property and also, we need to set UseNullString to true and NullString property to empty string.
C#
this.integerTextBox1.NullString = ""; this.integerTextBox1.UseNullString = true; this.integerTextBox1.DataBindings.Add("BindableValue", boundView, "IntegerField");
VB
Me.integerTextBox1.NullString = "" Me.integerTextBox1.UseNullString = True Me.integerTextBox1.DataBindings.Add("BindableValue", boundView, "IntegerField")
Reference link: https://help.syncfusion.com/windowsforms/integer-textbox/displaysettings#null-value-settings