Questions tagged [combobox]

Combobox allows to select one option out of several (similar to a dropdownlist), or to type a custom option.

allows to select one option out of several (similar to a ), or to type a custom option. The main difference with the is thus that it's editable.

Although comboboxes are primarily meant for single selection they may be customized to support multiple selections.

, and are quite similar. However, is a read-only dropdown list of options and is a read-only list of options. Whereas in case of , the user can either select from the dropdownlist or type a value directly into the input field.

Drop-down list is sometimes also refered to as non-editable version of combobox.

See Wikipedia entry for Combobox.

18062 questions
68
votes
11 answers

ComboBox.SelectedText doesn't give me the SelectedText

I am building a String and the code looks like String status = "The status of my combobox is " + comboBoxTest.SelectedText I am using WinForm in VS2010 The result looks like "The status of my combobox is "
Cocoa Dev
  • 9,361
  • 31
  • 109
  • 177
65
votes
9 answers

VB.NET: how to prevent user input in a ComboBox

How do you prevent user input in a ComboBox so that only one of the items in the defined list can be selected by the user?
CJ7
  • 22,579
  • 65
  • 193
  • 321
64
votes
5 answers

jQuery UI Autocomplete Combobox Very Slow With Large Select Lists

I'm using a modified version of the jQuery UI Autocomplete Combobox, as seen here: http://jqueryui.com/demos/autocomplete/#combobox For the sake of this question, let's say I have exactly that code ^^^ When opening the combobox, either by clicking…
elwyn
  • 10,360
  • 11
  • 42
  • 52
62
votes
5 answers

ComboBox SelectedItem vs SelectedValue

The following code works as you’d expect — MyProperty on the model is updated when the user picks a new item in the dropdown. comboBox1.DataBindings.Add("SelectedValue", myModel, "MyProperty", true, DataSourceUpdateMode.OnPropertyChanged); The…
Adam Lear
  • 38,111
  • 12
  • 81
  • 101
61
votes
4 answers

WPF ComboBox performance problems by binding a large collections

I'm trying to bind a large collection to a ComboBox and I faced performance problems when opening ComboBox's popup. I searched internet and found that using VirtualizingStackPanel as a items panel template might help, but it helped only partially.…
Alexey
  • 843
  • 1
  • 7
  • 9
61
votes
3 answers

QComboBox - set selected item based on the item's data

What would be the best way of selecting an item in a QT combo box out of a predefined list of enum based unique values. In the past I have become accustomed to .NET's style of selection where the item can be selected by setting the selected property…
cweston
  • 11,297
  • 19
  • 82
  • 107
60
votes
6 answers

How to get the selected item of a combo box to a string variable in c#

Can anyone tell me how to get the selected item of a ComboBox to a string variable? string selected = cmbbox.SelectedItem.ToString(); MessageBox.Show(selected); This gives me System.Data.DataRowView in my MessageBox
Roshan
  • 3,236
  • 10
  • 41
  • 63
59
votes
6 answers

Is there any difference between drop down box and combo box?

Is there any difference between drop down box and combo box [ HTML ]? Actually the point is, everytime i say something like: "there is some problem with the combo box", my senior says: "that's not a combo box that is a drop down", :)
Rakesh Juyal
  • 35,919
  • 68
  • 173
  • 214
58
votes
10 answers

Auto-width of ComboBox's content

Does anybody know a way to set the ComboBox's content's width to autosize I do not mean the ComboBox itself, just the opened content.
unicorn
  • 829
  • 2
  • 8
  • 13
58
votes
11 answers

AutoComplete ComboBox in JavaFX

I'm looking for a way to add autocomplete to a JavaFX ComboBox. This AutoFillBox is known but not what I'm searching. What I want is a editable ComboBox, and while typing the list should filtered. But I want also to open the list without typing and…
JulianG
  • 1,551
  • 1
  • 19
  • 29
57
votes
5 answers

C# WPF IsEnabled using multiple bindings?

I have a WPF xaml file describing a section of a GUI and I'd like the enabling/disabling of a particular control to be dependent on two others. The code looks something like this at the moment:
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
57
votes
3 answers

How to bind a ComboBox to generic dictionary via ObjectDataProvider

I want to fill a ComboBox with key/value data in code behind, I have this: XAML:
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
55
votes
6 answers

How do I set combobox read-only or user cannot write in a combo box only can select the given items?

I am facing a problem in setting the combo property such that only user can select the values form given items, but I cannot write in the combo box. How can I do so in C#?
Badr
  • 10,384
  • 15
  • 70
  • 104
53
votes
15 answers

How can I dynamically change auto complete entries in a C# combobox or textbox?

I have a combobox in C# and I want to use auto complete suggestions with it, however I want to be able to change the auto complete entries as the user types, because the possible valid entries are far too numerous to populate the…
Sam Hopkins
49
votes
10 answers

Why can't I select a null value in a ComboBox?

In WPF, it seems to be impossible to select (with the mouse) a "null" value from a ComboBox. Edit To clarify, this is .NET 3.5 SP1. Here's some code to show what I mean. First, the C# declarations: public class Foo { public Bar Bar { get; set;…
Matt Hamilton
  • 200,371
  • 61
  • 386
  • 320