Combobox List passing string - combobox

I have a VB6 application that has been running for quite sometime. Currently I'm trying to update one of the form that has a combobox 2.0. Because the combobox is populated with hundreds of items - I'm trying to update it so that users are able to click on a look up button next to it, where another window opens up with all the items from the combobox. User will be able to search by keyword and/or select an item and double click on it and have it appear in the combobox. The issue I'm having is with trying to pass no value or "" when CANCEL is clicked. I'm able to pass the value if I in the properties window my STYLE Is set to COMBO rather than list. However, the issue I come across is that with COMBO the value (text) in the combobox sometimes is not aligned properly. Is there a way to pass a "" value to a combobox 2.0 without changing the style to COMBO?

If they hit cancel set the ListIndex of your combo to -1 rather than setting the text property. This is the value for no item being selected.

Related

Kendo UI ComboBox using angularjs takes time to display value on preview

We are working with kendo ComboBox using angular js. We bind value to ComboBox using angularjs scope. On preview event, when we assign value on load time (fetched from database) to ComboBox, it takes time to display value on front side in ComboBox. As we marked on preview time, first it binds data to ComboBox and then display value. Is there any solution to display selected value/text on front side, whether the ComboBox get bound or not?
Yes you can do it by applying value in the modal and setting the text accordingly.
Like Your model is countryId and have text value as countryName and name of the combobox is countryComboBox then you can use it like below:
$scope.countryId = 1 (id of which you want to be displayed at first)
$scope.countryComboBox.value(1)
$scope.countryComboBox.text('INDIA')
it will initially set the text to INDIA.

Reset a ComboBox

I have a view that contains several ComboBox elements. For some reason old data remains from the previous time the view was opened and I would like to reset the combobox elements in the view every time it is opened. Is there a function that could that for me? I want it to be exactly how it is as if I rendered it the first time with the initial items. Would using setSelectedItem(vItem), setSelectedItemId(vItem), setSelectedKey(sKey), setShowSecondaryValues() help? If so, what do these keywords mean (selectedItem, selectedItemID, selectedKey, secondaryValues)?
Unfortunately you do not provide an example. Normally you bind your UI controls against a model, e.g. JSONModel. In this case the items of your ComboBox controls would be taken from the corresponding model. However, you can use method removeAllItems to achieve the desired behaviour.
UPDATE: Obviously the controls are bound and only the selection should be cleared.
Use setSelectedItem with value null to clear the selection. You could also use the binding to set the selected item automatically by using the selectedKey attribute, see example.

Passing text to a combobox VB6

Have a question - I'm having an issue with passing .text to a combobox that has a style set to LIST. I'm not sure why the issue is. Basically have a combobox that's populated with a lot of data. To make matter simple, I've created an additional form where user has a whole screen from where they are able to choose an item. The new form has the SAME EXACT items that combobox has - so when I pass the text from the new form to Combobox 2.0 - I get an error 380 - text propery is not set correctly
are you using the .AddItem method to add your text items?

Not selecting item in combobox

I need the following behavior for WPF Combobox:
i need autofilter in combobox. Took the implementation from here. But when there are several items in dropdown that are almost same-when i press DOWN it just selects the first one from list and hides others(see video of current behavior here: http://www.youtube.com/watch?v=_WYAgMTxc4M). If i want the second possible-i have to select it with mouse or write down the whole item display name in editable part of combobox. Is it possible to select item without changing editable part of the combobox, until i press ENTER, for example?
I think that problem is when you select the item, it fill the text area of ComboBox, than it notify that filter text changed and it applied new filter for the list, and the only one item remains in the list.
You should to rewrite this behavior that will apply filter only if KeyPressed / KeyDown / KeyUp events was fired.

silverlight combobox - highlight a few items in the popup list

I'm wondering if I can make fake sections in the popup menu:
The rule would be, if the 5th character of the displayed item is different from the 5th char of the previous item in the menu, it has to be highlighted
What do you think?
Thanks!
To achieve this would be a hack.
Normally the items that appear in the popup part of a combo box will be an instantiated data template, and each gets its own data item and has no clue or knowledge of the other items in the list, so you couldn't use a converter or anything else to achieve this behavior.
What you could do though is inject (attach) your own control into the popup part of the combo box, and take over the rendering of the data items. How you do this will depend upon which combo box you are using (i.e. MS or some other vendor's) and would be a whole new question.
Would that be easier if I were to create my own combobox as follow:
a TextBox associated with a Button that when pushed would popup a datagrid in which I could implement this conditional formatting?

Resources