combobox

Silverlight: Setting ComboBox Background-Color Programmatically

This seems like it's far more difficult than it should be, but I'd like to set the background color of a dropdown combobox programmatically (ie. if the user selects one value, I'd like it to appear red, otherwise blue...) What I've noticed is that if you just set the Background property to a SolidColorBrush, the only thing that seems to...

How to bind Combobox Datasource with an other column name from bindingsource?

Hello, Is there a way to bind Combobox datasource with an column from bindingsource? The following example works fine: //fill combobox with some data cBox.DataSource = dataSetOne.Table[0]; cBox.DisplayMember = "columnA"; cBox.ValueMember = "columnB"; //bind columnB from dataSetTwo with combobox cBox.DataBindings.Add("Text", dataSetTw...

WPF: Selecting all the text in and setting focus to a ComboBox's editable textbox

I have a WPF ComboBox which has its IsEditable property bound to a view model which can switch it on and off. When it is switched on, I want to give focus to the ComboBox and select all the text in the edit TextBox. I can't see the best to accomplish this. Should I replace the ControlTemplate, subclass the ComboBox base class, and provi...

Odd ComboBox behavior on resize

I have an issue where a ComboBox control will change it's Text value when it is resized. Here is some sample code that I worked up: Option Explicit On Option Strict On Public Class FMain Private Sub FMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load uxComboBox.DropDownStyle = ComboBoxSty...

How do you add a generic item to a ComboBox bound to a collection in WPF

I have a ComboBox in a WPF application that is bound to an ObservableCollection of Department objects in a C# ViewModel class. I want to use the combo box to filter another collection by department (And indeed it works for that now) The problem is that I want to add an additional option "All" to the top of the list. Is there a correct wa...

how to dynamically add combobox in windows forms(C#) and bound it to a column of a table in sql database

My windows form has an ADD button which adds a combo box to the form after each click. The problem is, i am not able to bind it to a table column at run time. Using an existing databinding source selects the same value in all the combo boxes. I am coding in C# here is the sample code ComboBox ocbNext = new ComboBox(); //HAVE set the r...

XamlParseException when databinding a ComboBox to a statically-defined array in XAML

I've been trying to solve this problem for over an hour now, and can't figure it out. Hopefully someone can see what I'm doing wrong. I have two separate projects, both of which populate a combobox with an array of Doubles in the UserControl.Resources section, then databind to it in the GUI. What I'm doing is essentially just this, wh...

Problem showing selected value of combobox when it is bind to a List<T> using Linq to Entities

I have a combobox which is has itemtemplate applied on it and is bind to a List of entity return using linq. i m using mvvm. It is bind to it successfully but when i set the selected value of it from code at runtime to show the selected value coming from db it doesn't select it. For reference here is my combobox xaml. ...

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", :) ...

Flex combobox custom icon

Trying to set the up and down state icons of a Flex Combobox to images. I see the property for changing the color of the icon, but no property to skin it. How can I do this? ...

Extending a combobox whith extended tooltips

I have a customer combobox that allows the programmer to set tooltips for the dropdown items at run time. It works great as long as the listing is from the dropdown (i.e. I press the down arrow.) However, I would like it to work for the "SuggestAppend" list as well, but it isn't. I 'borrowed' the code from an online source (can't remem...

Combobox selection control not coming out

Hi, I'm working with winforms comboboxes. When I select any item in combobox I've raised an event. But control can not come outside. When I scroll the mouse the selected event changing every time. how to prevent this? ...

How to make a WPF ComboBox editable with custom values

I would like to have a combobox that allows selection from a list of values and also allow a custom value from the typed in text. For display reasons the items are a complex type (lets say the combobox item template displays a patch of color and a flag indicating if it is a custom color). public class ColorLevel { public decimal Int...

how to remove item from one combobox

hi i m using 5 combobox in my asp.net 3.5 c# project .here i want remove item from other combobox which item is selected in other combobox. ...

Cloning the WPF ComboBox control: Ideas or suggestions

If have a control that acts like a record selector from a database, say, for example, customers. The control must act in certain ways allowing the user to type the name, the alias or the code of the customer, and the control will select the correct one, or offer a list of possible candidates, and other behaviors. I have tried to inheri...

Is it possible to catch a comboBoxes value before change with a change event

I am displaying a combo box in something of a WYSIWYG preview. I want the user to be able to click on the combo box and see the options inside, but I don't want them to be able to change the value. I tried using preventDefault() on the change event but it doesn't work. I don't want to disable it because I do want the user to be able to "...

WPF Two Way DataBinding - an Editable ComboBox to a DataView

<ComboBox Height="23" Margin="52,64,33,0" Name="comboBox1" IsSynchronizedWithCurrentItem="True" IsEditable="True" DisplayMemberPath="Value" SelectedItem="{Binding Path=Number, Mode=TwoWay}" /> public class Number : INotifyPropertyChanged { private strin...

How to select item with keyboard letter key in WPF combobox?

I have a WPF combobox and I want to go to items (for example) start with "e" in combobox. How? <ComboBox ItemsSource="{Binding Roles}" SelectedValuePath="Id" ItemTemplate="{StaticResource ComboBoxDisplayName}" SelectedItem="{Binding SelectedRole}" Width="150"...

Changing UserControl background based on SelectedValue from combobox

What I try to do: I have a list of person profiles in the background that I use with my combobox. The trigger is to change the background based on the gender of the person (bool Role.IsFemale). When I handle the SelectionChangedEvent in the code, I can see the Selectedvalue is true or false. I could now change the background directly or ...

WPF: How to customize SelectionBoxItem in ComboBox

I want to display a custom template/item as selected item in ComboBox (this item does not actually exist in the list of items and is updated differently). This does not even needs to be an item, just providing a custom view would work. How can I do this while staying within current ComboBox theme (so no ControlTemplate replacement poss...