combobox

WPF ComboBox binding behaviour

I have the following XAML markup: <TextBox x:Name="MyTextBox" Text="{Binding Path=SelectedCustomer.FavouriteProduct.ProductNumber, UpdateSourceTrigger=PropertyChanged}" /> <ComboBox x:Name="MyComboBox" ItemsSource="{Binding Products}" DisplayMemberPath="ProductName" SelectedValue="{Binding Path=SelectedCustomer.FavouriteProduct.Prod...

C#/WPF: Bind ComboBox to two Elements?

Hello, I've following objects public int PersonAge { get; set; } public List<PersonGroup> PersonList { get; set; } public class PersonGroup() { public string Name { get; set; } public string DefaultAge { get; set; } } My ComboBox is bound to PersonList, while I also have a TextBox which is bound to PersonAge. If a user ente...

combobox dataprovider

I have the following: <mx:RemoteObject id="myCFC" destination="ColdFusion" source="components.myCFC" showBusyCursor="true"> <mx:method name="getStuff" result="UserHandler(event);"/> </mx:RemoteObject> ... <mx:ComboBox id="propertyCode" dataProvider="{qry_stuff}" labelField="name" /> Index.as has: [Bindable] public var qry_...

How to save an entity without saving an associated entity used as a lookup for a WinForms combobox

When I try to save a new Order, the entity framework (.NET Framework 3.5 SP1) attempts to insert a new Status row into the database in addition inserting to a new Order row. I do not want to insert a new status row. I only want to insert an Order row to the database. I have the following tables (and columns) with 1-1 entity mappings: ...

How can I set the selected property in a custom user control which inherits XAML ComboBox?

I've built a custom user control which inherits ComboBox and has items which are KeyValuePair<bool, string> I want to set the boolean default value of this ComboBox so that when true it shows "Yes" and when false it shows "No". In the code below, when I set the selected value to true, then the ComboBox correctly shows "Yes". But wh...

C#/WPF: Binding Combobox ItemSource in Datagrid to element outside of the DataContext

Hello, I'd like to do following: public List<Users> PreLoadedUserList { get; set; } public List<RowEntries> SomeDataRowList { get; set; } public class Users { public int Age { get; set; } public string Name { get; set; } } public class SomeDataRowList { public int UserAge { get; set; } Now my (WPF Toolkit) DataGrid look...

Flex Combobox preChange event

Hi, I have a project in which i need to pop up an alert to the user before a combobox value is changed. This feature is to allow the user to stay in current state if modifications were not saved. Meaning that the user will be able to cancel the change. I have sub classed ComboBox and tried to hook on ITEM_CLICK of ComboBox.dropdown but ...

Problem when adding ComboBox to DataGridView .

Hi everyone, I have a DataGridView with custom columns. But when i add a "DataGridViewComboBoxColumn" and give to it a list with my custom class as datasource then i had the following error: The following exception occurred in the DataGridView: System.ArgumentException: DataGridViewComboBoxCell value is not valid. New EDI...

Extjs Combobox using json

What is the max size for combobox using json? I seem to die at 5000 json elements. ...

How to set an (unbound) SelectedIndex for a WPF Windows.Controls.ComboBox?

Hi, This should be easy but it's not working. I have a WPF combobox bound to a List. The items populate just fine I want the first item to show on startup. However! If the SelectedIndex is set to 0 or anything else it stays blank. Wozzup? Code Result: No item selected when the form loads. :-( ...

Binding problem which drives me crazy

Hello, I (and other programmers from another forum) have been trying to solve a binding problem for a few days. No one could help... Will anyone here be able to help me ? Apparently, the problem seems quite simple but when you dive in it, trust me, you burn some neurons... Here it is : I've created a test project which reproduces the pro...

.Net ComboBox Binding Issue

I have 2 comboboxes, each are bound to the the same DataTable like so: channelTypeCB.DataSource = SynergyData.ds.Tables["ChannelTypes"]; channelTypeCB.DisplayMember = "channelType"; channelTypeCB.ValueMember = "channelTypeID"; channelTypeCB.BindingContext = new BindingContext(); newSKChanTypeCB.DataSource = SynergyD...

AjaxControlToolkit combobox and focus behaviour

I have a requirement in a web application to duplicate the winforms combobox, with both the ability to select from the drop down list and to type text into the control. I've been looking at the AjaxControlToolkit combobox control since it gives the two behaviours along with other nice things like autocomplete. This is working fine but I...

Is this the best way to build AutoSuggest into a WPF ComboBox?

I have a Nationality ComboBox like the one below and want to make it so that the user can type letters to narrow in on the choices. I could solve this the way I started below by adding logic in the NationalityComboBox_KeyDown method. Is this the best way to build AutoSuggest into a ComboBox or is there a built-in way to do the same thin...

How to sort a ComboBox.Items collection of KeyValuePair<string,string> by Value?

I'm getting a KeyValuePair from a service and some of the values are not sorted, as reproduced below. How can I resort the KeyValuePair by value so that they display in alphabetical order in the ComboBox: public NationalityComboBox() { InitializeComponent(); Items.Add(new KeyValuePair<string, string>(null, "Please choose..."))...

Filtering combobox based on value member

I have two list that I load when my app starts. The first one loads a complete set of data from the database, the second one independently loads a set of associated data from file. Each list is loaded into a BindingSource and set as the DataSource for their respective combobox. The data is loading just fine. The issue is that I need to...

Erasing the background of the drop-down list of a subclassed combo

Hello, I have an issue with the drop-down list of a subclassed combo box, with its background actually. The situation is the following: there is a big holder window which contains a combo box, subclassed. The window class of the main window specifies a gray brush (COLOR_3DFACE), used by Windows to erase its background. The combo box i...

WPF DataGrid - Problem Customizing a ComboBox.

I have a Datagrid with a combo box bound column that works great as follows: <tk:DataGridComboBoxColumn SelectedValueBinding="{Binding DefaultLocationID}" SelectedValuePath="LocationID" DisplayMemberPath="LocationName" Header="Default Location" ItemsSource="{Binding Source=...

In Flex, how do I get the value of a ComboBox that is in a dataGrid?

I have a data grid that has ComboBoxes in two of its columns. What I need to do is get the values of those bombo boxes when a user highlights the row of the grid NOT when the user uses the comboBox. I understand how to pull the values out once the change handler is invoked on the comboBox, but I'm not seeing a way to get at the comboBox...

Error in Binding datasource to combobox

I have the below mentioned method where i am binding DataSource to the combobox control. // floorLocnList is coming from a webservice method private void lstFloor_BindFloor(FloorLocModel[] floorLocnList) { this.comboBox1.DataSource = floorLocnList; this.comboBox1.DisplayMember = "Location"; ...