The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a combo box which is databound to a SQL database. The database table does not include a "null" or "blank" entry. I would like the user to be able to select a blank to clear the current data which is set.
Currently, if there is no data and the user does not change the combo box, it works fine, however if they change the selection in the combobox, the blank disappears.
I tried changing the SelectedItem property to -1 and to Nothing, but it still shows the first item in the list.
Thanks
set the data source query for your combobox to include a union clause with a null or blank value.
eg.
my combobox datasource
SELECT Data FROM Table
UNION ALL
(SELECT '')
ORDER BY 1;
this should put the blank option as the first entry in the combobox list.
hope this helps
> I have a combo box which is databound to a SQL database. The database table does not include a "null" or "blank" entry. I would like the user to be able to select a blank to clear the current data which is set.
>
> Currently, if there is no data and the user does not change the combo box, it works fine, however if they change the selection in the combobox, the blank disappears.
>
> I tried changing the SelectedItem property to -1 and to Nothing, but it still shows the first item in the list.
>
> Thanks
>