combobox

Binding ComboBox.SelectedItem in Silverlight

This one is driving me crazy. Here's the XAML: <UserControl x:Class="SilverlightApplication1.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid x:Name="LayoutRoot" Background="White"> <StackPanel HorizontalAlignment="Left" VerticalAl...

Looking for a WPF ComboBox with checkboxes...

My google skills fail me. Anyone heard of a control like that for WPF. I am trying to make it look like this (winforms screenshot). ...

UpdatePanel - Flickering Combobox

Scenario - Outer update panel u1 Controls on u1 (wrapped in a div) - c1,c2,c3, t1,u2 ( t:textbox, c: combo, u: update panel) Control outside u1 - c1 - combo u2 has trigger as c2 - selected index changed. I've some controls like textboxes and combos inside a div(d1) The div is wrapped in an updatePanel(u1). There is another update panel(...

Binding ComboBox.SelectedItem in Silverlight (more)

Related to my previous question: http://stackoverflow.com/questions/855519/binding-combobox-selecteditem-in-silverlight I have a ComboBox bound like so: <ComboBox x:Name="PART_CommentaryList" HorizontalAlignment="Left" Margin="3" ItemsSource="{Binding Path=CurrentVideo.Commentaries}" SelectedItem="{Binding Path=Curr...

Getting the items of a ComboBox with its DataSource filled

Consider that there is a ComboBox which is populated through its DataSource property. Each item in the ComboBox is a custom object and the ComboBox is set with a DisplayMember and ValueMember. IList<CustomItem> aItems = new List<CustomItem>(); //CustomItem has Id and Value and is filled through its constructor aItems.Add(1, "foo"); aIt...

Restricted autocompletion on combobox

I have a combobox that I don't want users adding new data too, but I also want to let them type in the title of the object they want to select. Currently I am using this code: protected virtual void comboBoxAutoComplete_KeyPress(object sender, KeyPressEventArgs e) { if (Char.IsControl(e.KeyChar)) { //let it go i...

WPF Binding to a Combo using only a subset of a Collection's items

I'm trying to set a TwoWay binding to a combo box using only a selection of a collection's objects. Currently, everything works out ok if I just want to bind everything in the colelction, but in the example class below, what if I only want to show items where Active=True? I can filter the items using LINQ like ItemsSource = FROM x IN Col...

wpf combobox binding to enum,what I did wrong?

Hi, I have searched around and it seems very easy to bind enums to combobox, just retrieve Enum values as a list of strings via an ObjectDataProvider from the static Enum.GetValues method, however i can't get it to work. The error is Type ContactExportType was not found. I have an enum called ContactExportType, it resides on Enums cl...

disable items in a combobox

I have a combobox from which i need to programmatically disable items depending on an external event. The external event is done, I just need to disable the selection of the item and have it greyed out (like a context menu when certain options aren't available). It was decided that having items simply disappear would confuse users but ...

Combobox Dropdown Caching

We have a VB.Net application that has in the region of about 80 unique comboboxes spread over 15 Windows. Currently when a Window is loaded, the Comboboxes retrieve their contents directly from the SQL database. This is quite inefficient as the content of the comboboxes rarely changes, so it would make sense to retrieve all the combobox...

Disable ComboBox Without Changing Appearance

Is there a way to disable changing the value of a ComboBox in WPF without giving it the visual properties of a disabled ComboBox? For example, I know that for a text field you can set the IsReadOnly property to true. Doing this for a ComboBox however, does not prevent the user from selecting a different value. ...

ComboBox with ItemTemplate that includes a button

So, lets say I have a ComboBox with a custom data template. One of the items in the data template is a button: <ComboBox Width="150" ItemsSource="{Binding MyItems}"> <ComboBox.ItemTemplate> <DataTemplate> <Button Content="ClickMe" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> The problem...

WPF ComboBox - showing something different when no items are bound

I have a ComboBox, and i want to change its look when the ItemsSource property is null. When it is in that state, i want to show a TextPanel with the text "Retrieving data" in it, and give it a look kind of similar to the watermarked textbox. I figure to do this i need a ControlTemplate, and a trigger. I have the ControlTemplate here: ...

ComboBox items.count doesnt match datasource (C#)

Hi I have a combobox that is bound to a datasource. I want to dynamically add items to the combo box based on certain conditions. So, what I've done is add the options to a new list, and then change the datasource of the combobox like so: cbo.DataSource = null; cbo.DataSource = cbos; cbo.DisplayMember = "Title"; cbo.ValueMember = "Valu...

WPF Combobox graphical representation of integer

I'd like to use a WPF ComboBox in a similar way to the Flag column on Outlook where you are presented with a choice of different flags to select. My flags will be stored as Integers in the DB, each number is represented by a different color flag. Has anybody already done this or similar. Failing that any pointers to the best way to ach...

WPF ComboBox...how to set the .Text property?

Is there a way to set the .Text property of the Wpf ComboBox control directly? My combobox is bound to a List collection, but when I try to set .Text property in the DropDownClosed event, it totally ignores it. ...

Flex Question: Can I use a ComboBox in Flex to change a view stack?

I am trying to use a combobox in flex with an array to change to a canvas in a view stack. Can I do this with some custom action script? The UI I am designing could really benefit form this. ...

How does the WPF ComboBox disable the window from scrolling or resizing

I am trying to recreate some of the behaviors that occur when the combobox dropdown is open. When this happens, if there is a scrollviewer then scrolling gets ignored. The ability to resize the window is disable. I know that there is a ResizeMode, but the results of changing the mode are visibly jarring to the window. If the window goes ...

Binding an enum to a WinForms combo box, and then setting it.

Hi, a lot of people have answered the question of how to bind an enum to a combo box in WinForms. Its like this: comboBox1.DataSource = Enum.GetValues(typeof(MyEnum)); But that is pretty useless without being able to set the actual value to display. I have tried: comboBox1.SelectedItem = MyEnum.Something; // Does not work. SelectedI...

WPF Mouse behavior when ComboBox is focused

When the WPF ComboBox is clicked and in-focus, the only interaction that occurs after that can be with the ComboBox. If anything else is interacted with, including the window functions (minimize, restore, close, resize) and any control in the window, the action is ignored and the ComboBox loses focus. In addition, MouseEnter and MouseL...