combobox

[MFC] What is the reciprocal of CComboBox.GetItemData?

Instead of associating objects with Combo Box items, I associate long ids representing choices. They come from a database, so it seems natural to do so anyway. Now, I persist the id and not the index of the user's selection, so that the choice is remembered across sessions. If id no longer exists in database - no big deal. The choice wil...

[C#/WPF] Combo box Item source = ObservableCollection & I need a '-None-' dummy entry at the top

I have a combo box using an observable collection as a datasource and I want a "dummy" value of "None" as the first item in the box as it controls filters against other data sources. Other databound objects also use the same observable collection so adding a "None" value directly to the datasource is not possible as I dont want, for exa...

populate combox on windows mobile 5.0

Hi, I try populate combobox in windows mobile 5.0 pocket pc but i have this error: Value does not fall within the expected range. the datatable return from dataset on the webservice: the method is: public void loadComboBox(ref ComboBox ComboBoxGen, string DisplayText, string Value,DataTable dt) { ComboBoxGen.DataSource = dt; ...

Triggering wx.EVT_COMBOBOX after programatically changing ComboBox selection?

As per the title, is there any way to programatically change the selected item in a ComboBox and have it raise an event? I am setting the selected item using myComboBox.SetSelection(index), but this doesn't raise the wx.EVT_COMBOBOX event. ...

wpf combobox padding

This is a simple question How do you remove the space between the content of a combobox and the border of it. E.g. If the selection of a combobox is "Selection 1" then the "S" is drawn at the very top left of the ComboBox control with no whitespace spacing between it and top left portion of the control. I did this <ComboBox Padding="...

Databind a datagrid header combobox from ViewModel

I've got a Datagrid with a column defined as this: <Custom:DataGridTextColumn HeaderStyle="{StaticResource ComboBoxHeader}" Width="Auto" Header="Type" Binding="{Binding Path=Type}" IsReadOnly="True" /> The ComboBoxHeader style is defined in a resource dictionary as this: <Style x:Key="ComboBoxHeader" TargetType="{x:Type my:DataGridCo...

Excel VBA Userform Combobox problem

I'm having difficulties with a Combobox in a userform in an Excel document. The combobox either doesn't appear in the userform, or the combobox remains blank, and when I enter any character in it, the list of items appears, but 2 or 3 times, instead of just once. When I select an item, the chosen item doesn't appear in the box. It seem...

Choosing a Custom default combo box value in VB.NET

Hi, I got a combobox which is filled with values from datasource. By default the first value is chosen which is fine but I need to display "Choose country" as the default combobox text. The user then can choose from the drop down list. The reason is when the first value from datasource is chosen as the default value the rest of the ...

Number of items in a combobox in Flex

HI, How do i retreive the total number of items (count) of a combo box in Flex? ...

Casting SelectedItem of WPF Combobox to Color causes exception

I have a combobox databound to the available system colors. When the user selects a color the following code is fired: private void cboFontColour_SelectionChanged(object sender, SelectionChangedEventArgs e) { Color colour = (Color)(cboFontColour.SelectedItem); } This throws a Casting Exception with the following message: "Specifie...

WPF - Setting ComboBox.SelectedItem in XAML based on matching object

Hi, so, I have templated combobox that is basically acting as a simple colour palette. It is populated with a list of SolidColorBrush objects. Fine. Now, I have some data that holds the hex value of the current colour. I have a converter that converts the hex into a SolidColorBrush. Also fine. Now, I want to set the SelectedItem prop...

Wpf SelectedItem wont work for a Combobox in a ListView

Hi there, I´ve got a problem with a Combobox in a ListView. I´ve got a class called "Substrate". This class contains an object of a class called "SubstrateType". I want to show the objects of the class "Substrate" in a Listview. Each property of the "Substrate" is presented in the columns of the Listview. For the different "SubstrateTyp...

how to add a "Please select" item to a dropdown box in asp.net mvc

i have the following code in an asp.net mvc view. <% = Html.DropDownList("Filter", new SelectList(Model.Items, "Id", "Name", 0), new { @id = "Filter", @class = "autoComplete1" })%> i want to add an element at the top of the dropdown as the first item that says, "Please select". do i have to add that into my Model.Items or is there a ...

Excel VBA ComboBox2 doesn't get the right content

Hi, I'm having a problem with the content of a combobox. On my userform, there are 3 comboboxes. Depending on the chosen item from combobox1, combobox2 should display either set 1 or set 2. The same will be happening with the content of combobox 3, which depends upon the combination of chosen items from combobox 1 and 2. However, I'...

Controlling Too Many listboxes ( C#)

I have almost 200 listboxes. I'm changing their visibility according to my variables from database. So I thought that, I prepared a arraylist. like this ListBox[] lbs = this.Controls.OfType<ListBox>().ToArray(); And used like this. for (int idx = 0; idx < Convert.ToInt32(ds.Tables[j].Rows[i][2])*12; idx++) lbs[idx].Visible = tr...

Show cue banner for wpf ComboBox with grouping

I have a ComboBox in my WPF form: <ComboBox Margin="75,0,15,102" Name="videoFormatCombo" Height="23" VerticalAlignment="Bottom" DataContext="{StaticResource GroupedVideoFormats}" ItemsSource="{Binding}" ItemTemplate="{StaticResource VideoFormatTemplate}"> <ComboBox.GroupStyle> <Gro...

Adding ComboBoxItem to ComboBox Issue in Silverlight 4

I recently upgraded my Silverlight app from 3 to 4. After a few hours of bashing my head against the wall, trying to resolve an issue, I've narrowed down the problem to this: I have a user control, with a ComboBox inside it. The ComboBox has a single ComboBoxItem child. The user control exposes a get accessors that returns the ComboBox'...

How to change the style of a combobox to a label or hyperlink in WPF?

I want to change the style of a combo box control to look like a hyperlink. When user clicks on the hyperlink ( combo box) it show options in the combobox to select. The idea is that I want combo box control to display as a plain text ( more readable form). If anybody created this type of sytle please let me know. ...

Flex 4: Dynamic ComboBox/List problem [object Object_Type] even with labelField defined

I am dynamically populating a ComboBox with an HTTPservice calling an XML file. This all works dandy through the Flash Build 4 interface. Below is the ComboBox code: <s:ComboBox id="cbSockOptions" change="cbSockOptions_changeHandler(event)" selectedIndex="1" enabled="true" creationComplete="cbSockOptions_creationComplete...

Is it possible to set the width of a jquery autocomplete combobox

i am using this jquery ui combobox autocomplete control out of the box off the jquery ui website: my issue is that i have multiple comboboxes on a page and i want them to have different widths for each one. i can change the width for ALL of them by adding this css: .ui-autocomplete-input { width:300px; } but i can't figure o...