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. Image for the cookie policy date

sfcombobox dropdown size changes

I have 3 sfcomobox controls, one under the other. Max. drop down entries is set to 12 for each combobox. Each control has as a datasource  a List(OfString)(). The first combobox list is filled when the form opens. When the user selects an entry in sfcombobox1, I do the following.

sfcombobox2.datasource = nothing
sfcombobox3.datasource = nothing
sfcombobox2.rextbox.clear()
sfcombobox3.textbox.clear()
comboList2 = nothing

Then I execute a SQL procedure to get the contents of a list depending on the value of combobox1.
Then I fill the comboList2 with the values of the query table
Then I assign the comboList2 as a datasource to sfcombobox2
i.e.
sfcombobox2.datasource = comboList2.

The entries in sfcombobox3 depend on the selection of sfcombobox3. When the user makes a selection from sfcombobox2, I clear the list and textbox of sfcombobox3 and do a query and re-populate list3 and assign it as datasource to combobox3.

The first time when the form opens and the user makes selections, all comboboxes open showing 12 items. (There are more than 12 items for each list). If the user changes the selection of combobox1 a second time, combobox2 only opens showing 1 1/2 lines. The box is short and th list is cut off. Same for combobox2 and 3. The attached screenshots show what happens.

Can you please advise how I can make sure the combobox dropdowns open the same size for all instances, even if the user keeps changing selections?



Attachment: Problems_with_sfcombobox_1f3f5a4c.zip

4 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team December 10, 2019 07:49 AM

Hi Tom,

 

Thank you for contacting Syncfusion Support..

 

We are currently analyzing the reported behavior with SfComboBox using the provided scenario. We will check and update you details on 12th Dec 2019.

 

Regards,

Vijayalakshmi V.R.

 



TK Tom Krieg December 10, 2019 07:32 PM

Hi Vijayalakshmi,

I've been working on this problem and have found that the behaviour does NOT happen when I clear() the list which is used as the datasource for the sfcombobox. The behaviour only occurs when I set the list = nothing, instead of using list.clear().

One other problem I've found is that when setting the sfcombobox to suggest or suggest/append, if the sfcombobox.text is set to a value by code, the dropdown appears with just one entry, i.e. the suggested value equivalent to the text. To stop this behaviour I've had to set sfcombobox.autocompletemode = none, then fill all the sfcombobox.text fields from a database record, then set autocompletemode to suggest/append. Is there a better way to stop the dropdown happening when the .text property is set by the code?


VR Vijayalakshmi Roopkumar Syncfusion Team December 12, 2019 05:10 PM

Hi Tom,

 

Thank you for your update.

 

Query : I've been working on this problem and have found that the behaviour does NOT happen when I clear() the list which is used as the datasource for the sfcombobox. The behaviour only occurs when I set the list = nothing, instead of using list.clear().

 

When the ItemSource has been cleared using clear method, the item would be properly removed. So we recommend you to use the clear method.

 

Query : To stop this behaviour I've had to set sfcombobox.autocompletemode = none, then fill all the sfcombobox.text fields from a database record, then set autocompletemode to suggest/append. Is there a better way to stop the dropdown happening when the .text property is set by the code?

 

We are currently checking this behavior at our end. We will check and update you the details by 13th Dec 2019..

 

Regards,

Vijayalakshmi V.R.

 



VR Vijayalakshmi Roopkumar Syncfusion Team December 13, 2019 08:18 PM

Hi Michelle, 
 
Thank you for your update. 
 
Query: To stop this behaviour I've had to set sfcombobox.autocompletemode = none, then fill all the sfcombobox.text fields from a database record, then set autocompletemode to suggest/append. Is there a better way to stop the dropdown happening when the .text property is set by the code? 
 
We have checked your reported behavior that you don’t want to open the dropdown after setting the ComboBox’s Text by handling the DropDownOpening event of SfComboBox.Please find the sample for your reference: 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi V.R. 


Loader.
Live Chat Icon For mobile
Up arrow icon