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 can''t believe this hasn''t been addressed before.
Assume following situation:
screen with a comboboxadv on it.
following binding:
DataTable dt = this.ds_new.Tables[0];
dt.Constraints.Clear()
foreach (DataColumn dc in dt.Columns)
{
dc.AllowDBNull = true;
}
//add an empty row to the datatable
//because we need to be able to blank out
//the combobox
DataRow dr = dt.NewRow();
dt.Rows.Add(dr);
this.cmbAdv.DataSource = dt;
this.cmbAdv.DisplayMember = "CODE"; this.cmbAdv.ValueMember = "CODE";
this.cmbAdv.DataBindings.Clear();
this.cmbAdv.DataBindings("SelectedValue", this.ds_other.Tables[0], "OTHERCODE");
Whenever I''m blanking out the value in the combobox in my screen and then I save my values to the DB, the combobox first defaults to the first entry in the list and saves that value to my ds_other.Tables[0]...
what do I have to do to be able to save "" or null values?
setting this.cmbAdv.TextBox.Text to "" or null does not help, neither does setting .Text, .SelectedIndex to -1 or whatever...
any help would be greatly appreciated!
ARAnupama Roy Syncfusion Team March 20, 2006 01:56 PM UTC
Hi Filip,
Sorry for the delay in response.I am looking into this and will get back to you soon.
Regards,
Anu.
ADAdministrator Syncfusion Team March 30, 2006 08:14 AM UTC
Thank you!
I hope you will find a solution :)
ARAnupama Roy Syncfusion Team March 31, 2006 02:00 PM UTC
Hi Filip,
Sorry for the delay in response.
The intended behavior of the DropDownList DropDownStyle of ComboBoxAdv is to ensure that the Text property will always be one of the entries in the Items list.And this is how the .NET ComboBox control behaves too. Our ComboBox controls are closely modelled on the .NET ComboBox and we have maintained similar behavior for consistency purposes. I am really sorry to inform you that I am unable to provide you a workaround also.One thing you can do is ,if you do not have cross connectivity with fields,before loading the items from your database,you can try to check for the duplicate values.I am not very sure how your scenario would match with this.
We regret very much for the inconvienience caused.
Regards,
Anu.