combobox

Multiple item combo box with headers in resource dictionary?

流过昼夜 提交于 2019-12-18 06:48:38
问题 I have followed the accepted answer of this question to define a multi-column combobox with headers. It was not working for me, so I made some changes to it and now it works. Here is the xaml to create a multi-column comboBox with headers. <Page.DataContext> <vm:ItemsViewModel /> </Page.DataContext> <Page.Resources> <CollectionViewSource x:Key="UnitsCollection" Source="{Binding Units}" /> </Page.Resources> <ComboBox Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Grid.IsSharedSizeScope="True

Winforms Binding a ComboBox SelectedItem to an Object Property

隐身守侯 提交于 2019-12-18 05:13:17
问题 I have two simple classes: public class Customer { public String CustomerID { get; set; } public String Forename { get; set; } public String Surname { get; set; } } and public class Order { public String OrderID { get; set; } public Decimal Value { get; set; } public Customer OrderedBy { get; set; } } I then create a list of Customer objects: List<Customer> customers = new List<Customer>(); customers.Add(new Customer() { CustomerID = "1", Forename = "John", Surname = "Smith"}); customers.Add

Dynamically changing the text of items in a Winforms ComboBox

混江龙づ霸主 提交于 2019-12-18 05:05:06
问题 I have a Winforms ComboBox that contains instances of a custom class. When the items are first added to the Items collection of the ComboBox , the ToString method is call on each of them. However when the user changes the language the application is running in, the result of the ToString method changes. Therefore how can I get the ComboBox to call the ToString method on all items again without having to remove all items from the ComboBox and adding them back in? 回答1: Thanks svick,

Dynamically changing the text of items in a Winforms ComboBox

折月煮酒 提交于 2019-12-18 05:04:39
问题 I have a Winforms ComboBox that contains instances of a custom class. When the items are first added to the Items collection of the ComboBox , the ToString method is call on each of them. However when the user changes the language the application is running in, the result of the ToString method changes. Therefore how can I get the ComboBox to call the ToString method on all items again without having to remove all items from the ComboBox and adding them back in? 回答1: Thanks svick,

Remove typing cursor from combobox

孤街浪徒 提交于 2019-12-18 04:53:06
问题 I am using an ExtJS combobox. There is a typing cursor when focusing on the combobox. I tried to implement editable: false when creating the combobox, but it helped only for chrome. Also tried clearListeners() function to see if this works on that cursor - didn't help, it still appears in FireFox and IE. The other idea is to set disabled on the input field in combobox. When I did it manually, it helped. But when I wrote the next Ext.get('bu-encodingcount-combobox').select('input').set(

Combobox SelectedItem doesn't update when source changes

倾然丶 夕夏残阳落幕 提交于 2019-12-18 04:49:09
问题 I have a viewmodel which implement INotifyPropertyChanged . On this viewModel is a property called SubGroupingView . This property is bound to the selected item of a combo box. When i change the combo box, the source property is being updated fine, but when I change the source property or when the control is initialized, the combobox.selectedItem is NOT reflecting what exists in the property. Here is some code to get you started: <ComboBox Grid.Column="3" Grid.Row="1" Margin="0,1,4,1"

wpf combobox binding

隐身守侯 提交于 2019-12-18 04:09:37
问题 Hi I´m trying to bind a List<> to a combobox. <ComboBox Margin="131,242,275,33" x:Name="customer" Width="194" Height="25"/> public OfferEditPage() { InitializeComponent(); cusmo = new CustomerViewModel(); DataContext = this; Cusco = cusmo.Customer.ToList<Customer>(); customer.ItemsSource = Cusco; customer.DisplayMemberPath = "name"; customer.SelectedValuePath = "customerID"; customer.SelectedValue = "1"; } I become no Error but the Combobox is always empty. Cusco is the Property of my List. I

Filterable multi-select combobox shuttle/transfer widget [closed]

流过昼夜 提交于 2019-12-18 00:13:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Background I am looking for a jQuery- or JavaScript-based combobox shuttle widget that allows the user to filter the source list. The source list is a combobox (on the left) and the destination list is a second combobox (on the right). Mockup The widget should resemble: An existing jQuery widget: Usage The user

Display a Default value for a Databound WPF ComboBox

岁酱吖の 提交于 2019-12-17 23:16:21
问题 I have a databound WPF comboxbox where I am using the SelectedValuePath property to select a selected value based on something other than the object's text. This is probably best explained with an example: <ComboBox ItemsSource="{Binding Path=Items}" DisplayMemberPath="Name" SelectedValuePath="Id" SelectedValue="{Binding Path=SelectedItemId}"/> The datacontext for this thing looks like this: DataContext = new MyDataContext { Items = { new DataItem{ Name = "Jim", Id = 1 }, new DataItem{ Name =

WPF Data binding: How to data bind an enum to combo box using XAML? [duplicate]

懵懂的女人 提交于 2019-12-17 22:15:08
问题 This question already has answers here : How to bind an enum to a combobox control in WPF? (18 answers) Closed 4 years ago . I have a class: public class AccountDetail { public DetailScope Scope { get { return scope; } set { scope = value; } } public string Value { get { return this.value; } set { this.value = value; } } private DetailScope scope; private string value; public AccountDetail(DetailScope scope, string value) { this.scope = scope; this.value = value; } } and an enum: public enum