combobox

Is there a BeforeUpdate for a C# ComboBox on a Winform

I come from the VBA world, and remember there was a BeforeUpdate call I could make on a combobox. Now I am in C# (and loving it) and I was wondering is there a BeforeUpdate call for a ComboBox on a Winform? I can make an invisible textbox and store the info I need there and after the update, look at that box for what I need, but I was h...

Reordering of controls within a flow layout panel

Good afternoon, I'm having trouble using the flowlayoutPanel in a C# winform application. What I basically have is a flow layout panel that has 3 sections. Section #1 is a set of 2 controls .. two dropdown controls, they are always in the same order, always visible in all instances Section #2 is a set of 5 different controls ... based...

Combobox with image - passing value to drawItem event

Hi, I have a C# app with a combo box. I was add items to it in the usual way using a loop to loop through some objects and add each name property value to the combobox: comboBox1.Items.Add(object.name); But then I decided I would like to display an image by the text, so I changed the drawMode and the dropDownStyle and set up an even...

C# Update combobox bound to generic list

Hello! I have a combobox on my form that is bound to a generic list of string like this: private List<string> mAllianceList = new List<string>(); private void FillAllianceList() { // Add alliance name to member alliance list foreach (Village alliance in alliances) { mAllianceList.Add(alliance.AllianceName); } ...

ComboBox SelectedIndex can't be reset

I've got a comboBox on my form. if i select, let's say, 5th item in the ui, then programmatically set selected index to -1 it looks like the selected item was reset - the text is not displayed, if i view the items with a mouse the first item is the item with index zero. but if i click the arrow down button instead, the selected item will...

How to load data from stored linq procedure in combo box?

I have stored procedure in dbml file, I want do smth like this Private Sub GetData() Dim dal = New DataAccess Dim dateList = dal.context.GetAsDateList() Dim enumerator As IEnumerator = dateList.GetEnumerator() While enumerator.MoveNext() cmbDate.Items.Add(enumerator.Current) End While End Sub But I have ...

How can I get the Silverlight ComboBox to resize the dropdown after I change ItemsSource?

There are various posts on the web about this issue whereby the ComboBox only changes its dropdown height to fit the items on its very first dropdown. Any changes to the items shown doesn't cause the dropdown to resize. The various workarounds I have found don't seem to work for me, so I was wondering if anyone had found a way to solve t...

How to populate each DataGridViewComboBoxCell with different data?

i have two DataGridViewComboBoxColumn that i add at run time i need the items of the first DataGridViewComboBoxColumn to stay the same in all the rows of the gridview but i want the items of the second DataGridViewComboBoxColumn to be different from row to the other depending on the selected item of the first DataGridViewComboBoxColumn ...

C# How do I set the selected item in a comboBox to match my string?

I have a string "test1" and my comboBox contains test1, test2, test3, how do I set the selected item to "test1"? I.e. how do I match my string to one of the comboBox items? I was thinking of the line below but this doesn't work. comboBox1.SelectedText = "test1"; Thanks ...

How to create a derived ComboBox with pre-bound datasource that is designer friendly?

I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a list of objects that I retrieve from the database. Idea is other developers can just drop this control on their form without having to worry about the datasource, binding, unless they want to. I have tried to extend combobox and then set the Data...

Lining up the text in a tool tip, with the text in a combobox

I see a lot of programs where if the text doesn't fit inside the bounds of the control, you can put your mouse over the control and the tooltip text will show you the full unclipped text, and also the tooltip text lines up completly with the text in the control. I'm trying to do that with a combobox in VB 2005 (.net version 2.0). In th...

Why does this simple databinding scenario not work? (ComboBox related)

Hi all, I've been scratching my head on this one for a while now and am stumped at the moment. The problem scenario is easier to explain as code so hopefully it speaks for itself. First of all, I have a silverlight application with the following in the XAML... <UserControl x:Class="SilverlightApplication2.Page" xmlns="http://schemas.m...

Can't alter DisplayMember in WinForms ComboBox

I'm trying to alter how a combobox is displayed using the following code: private void UpdateMapRoadPointList(List<GeographicAddress> plstMapRoadPointList) { cboFind.DataSource = plstMapRoadPointList; cboFind.DisplayMember = "ShortCode"; cboFind.ValueMember = ""; } GeographicAddress is a class which...

ComboBox that remembers recently entered values and can autocomplete

I'm developing a Desktop Search Engine in VB.NET I'm using a ComboBox to specify the search query (string). I want the ComboBox to remember and display recent queries. I also want the ComboBox to try and Autocomplete the queries as the user is typing. What is the best way to implement this? ...

Databinding Silverlight Comboboxes with Lists of Objects - working but ugly.

I'm developing a business application, using Silverlight for the UI and a WCF webservice for the back-end. In the database I have a number of lookup tables. When the WCF service returns a business object, one of the properties contains the entire row out of the lookup table instead of just the foreign key, so in the UI I can display thin...

Cancel ComboBox dropdown closing

I want to cancel this operation if the user selects a specific item because I don't want to force the user to open the dropdown again. Can this be done? ...

EXTJS Combobox not selecting by valueField after expand

I have written some code that works pretty well, but I have a strange bug Here is an example... PLEASE WATCH MY COMBOBOX BUG VIDEO Like I said, this works well every time datachanged fires - the right index is selected and the displayField is displayed but, everytime after I type some text in the combobox, later, when the "datachan...

How do you set up a combobox in Silverlight to allow clicking through items?

I have several databound comboboxes in my application and I notice that when i open the combobox to click on an item it doesn't select the item unless i click to the right of the text. I'm assuming there is some way to include the text area as part of the item in terms of making a selection. Any help would be appreciated. ...

C# Dictionary Application: Applying Values through the selection of keys

I have a dictionary that I am using to define the ratings of copper cable. I want to use these values to calculate how many cables it will take to meet a certain connections rating. The size of the connection, the cable type, and system type are selected by two ComboBoxs named cb_amperage, cb_cable_size and, cb_system_type. The answer f...

Free advanced dropdown list control (Windows Forms .Net)

I'm looking for a free advanced dropdown list control. Basically something that provides a dropdown list which can have icons, and multiple bits of text per entry (preferably one large bit of text and then a smaller bit of text underneath). Anyone know of such a control? I've had a look but can't seem to find one. If I can't find it I ...