combobox

How to Populate ComboBox from access db in C#

你说的曾经没有我的故事 提交于 2019-12-25 00:36:32
问题 I have the next combobox: this.comboBoxProd.Enabled = false; this.comboBoxProd.FormattingEnabled = true; this.comboBoxProd.Items.AddRange(new object[] { "Cameras", "------------", " Digital IXUS 850 IS ", " Digital IXUS 900 Ti ", " Digital IXUS 75 -NEW- ", " Digital IXUS 70 -NEW- ", etc. I want to change it and take the values from a db. My database name is bd1.mdb and in the table Cameras it has the following fields: CamID, Cameras, Warranty, Year. I am only interested in the "Cameras" field

Setting combo box foreground color for the disabled state

爷,独闯天下 提交于 2019-12-24 22:58:25
问题 I want to change color of combo box for diasbled state to more darker one. Please let me know how do achieve this using triggers or any other way. Thanks !! 回答1: Change the color in a simple property trigger: <Style TargetType="ComboBox"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="Green"/> </Trigger> </Style.Triggers> </Style> 回答2: Try this:- <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" Value="

how to display most recently used list in combo box

爷,独闯天下 提交于 2019-12-24 22:51:17
问题 I'm using infragistics WPF editors and XamComboEditor. In previous WinForms version there was MRU list capability. What it basically does is it displays list of most recently used items at the beginning of the list and separates those items with some separator (which cannot be selected). Regular list of combo box items follows after this separator. Now, infragistics combo does not provide this functionallity. I'll have to develop it on my own and the question is how to approach this. My

Pass Dropdown combobox value with Json auto filling userform

本秂侑毒 提交于 2019-12-24 22:40:33
问题 I have a dropdown/combo box, this is how its made @Html.DropDownList("combobox", Model.Sizes, "--select--") It uses a jquery ui widget which is, <script> (function ($) { $.widget("custom.combobox", { _create: function () { this.wrapper = $("<span>") .addClass("custom-combobox") .insertAfter(this.element); this.element.hide(); this._createAutocomplete(); this._createShowAllButton(); }, _createAutocomplete: function () { var selected = this.element.children(":selected"), value = selected.val()

DisplayMemberPath and SelectedValuePath issue while using LINQ to generate ComboBox.ItemsSource

大城市里の小女人 提交于 2019-12-24 22:36:13
问题 XAML code: <ComboBox Name="comboBoxAccountName" DisplayMemberPath="AccountName" SelectedValuePath="AccountID" /> ItemComboBoxAccount class: public class ItemComboBoxAccount { private int accountID; private String accountName; public int AccountID { get { return accountID; } set { accountID = value; } } public String AccountName { get { return accountName; } set { accountName = value; } } } LINQ query: comboBoxAccountName.ItemsSource = (from accounts in dataContext.Accounts select new {

Databinding a list (in an object) to a combobox in VB.net

99封情书 提交于 2019-12-24 22:26:26
问题 VB 2008 .NET 3.5 I have a custom "Shipment" object that contains a list of "ShippingRate" objects. This list of "ShippingRates" is accessible through a property "Shipment.PossibleShippingRates." That property simply returns a copy of the list of "ShippingRate" for that particular Shipment. My UI layer receives a list of "Shipment" objects from the BLL. This list is databound to a datagridview, and shows details relevant to the Shipment such as Shipping Address, etc. I want to bind the

Extjs keeping current select items in combo and adding new items

╄→尐↘猪︶ㄣ 提交于 2019-12-24 22:17:23
问题 I have a Role combo box which already have 3 item (loaded User Model). Now I need to add the 4th item to the selection but it doesn't keep the current items, and when I add the 4th one, it will be the only item selected in combo. Is there anyway to implement this behavior ? My grid record is selected like this doSelectUser: function(grid, record) { var me = this; var selectedRoleVals = record.get('roles'); me.getUserForm().loadRecord(record); And then I click the combo box in User Form:

C# WPF Filter ComboBox based on RadioButtons

拥有回忆 提交于 2019-12-24 21:41:51
问题 I have a WPF project with a Ribbon ComboBox showing a list of countries that I'm trying to filter depending upon a selected RadioButton option (All, Africa, Asia, Europe). I'm basing my code on COMBOBOX filtering in WPF with MVVM which uses a ComboBox to select a continent and show the filtered countries in a ListBox but I'm having trouble converting this to use RadioButtons. There's a problem with the XAML isChecked="..." lines which appear to cause an 'Input string was not in a correct

Weird behavior caused by using .Net ComboBox properties SelectionStart & SelectionLength in “DropDownList” mode

自作多情 提交于 2019-12-24 21:25:04
问题 We have a sample application with such handler for a combobox in "DropDownList" mode: private void comboBox1_Leave(object sender, EventArgs e) { comboBox1.SelectionStart = 0; comboBox1.SelectionLength = 0; } the code above behaves differently depending whether the application has CALLWNDPROC hook loaded or not. If application has a CALLWNDPROC hook in it - the code above would throw exception whenever combobox loses focus. Without the hook - that code doesn't throw. these are few lines from

Not able to make cascading comboboxes work

痴心易碎 提交于 2019-12-24 21:09:39
问题 Here is my code to create cascading comboboxes. I am trying to populate Family Combobox(ComboBox2) based on the value selected for Segment Name(combox1).I am able to populate the first Combo with a static resource but my second one shows blank. I am calling a method called "FillComboBoxFamilyData(SegmentCode)" on the selection change event of first combobox. XAML CODE: <Grid Height="142" HorizontalAlignment="Left" Margin="49,113,0,0" Name="grid3" VerticalAlignment="Top" Width="904"> <ComboBox