We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

ComboBoxAdv problem...

Thread ID:

Created:

Updated:

Platform:

Replies:

42021 Mar 17,2006 05:53 AM Mar 31,2006 09:00 AM Windows Forms 3
loading
Tags: Tools
Filip L'Hommelet
Asked On March 17, 2006 05:53 AM

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!

Anupama Roy [Syncfusion]
Replied On March 20, 2006 08:56 AM

Hi Filip, Sorry for the delay in response.I am looking into this and will get back to you soon. Regards, Anu.

Administrator [Syncfusion]
Replied On March 30, 2006 03:14 AM

Thank you! I hope you will find a solution :)

Anupama Roy [Syncfusion]
Replied On March 31, 2006 09:00 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;