combobox

Xceed datagrid showing combobox

不羁岁月 提交于 2020-01-14 05:28:13
问题 I wanted to use "Xceed DataGrid for WPF" community edition to show items in WPF application that are already coming correct for a Propertygrid. The textbox (first name) is working fine, but combobox is not working. Problem is combobox is not populating anything and it is not setting the gender correctly. My simple code is given below. XAML: <Window.Resources> <xcdg:DataGridCollectionViewSource x:Key="mySource" Source="{Binding Path=SelectedEntity}" /> </Window.Resources> <Grid> <xcdg

How can I hide the selected item in a WPF combo box?

有些话、适合烂在心里 提交于 2020-01-13 19:41:06
问题 I want to hide the selected item from the opened WPF combo box, basically to show instead of this: item2 item1 item2 item3 this: item2 item1 item3 How can this be done? 回答1: Why don't you change the selected item's visibility instead? 回答2: Since the combobox's item's view is automatically generated from the collection of items it contains, what you need to do is either remove the selected item from the combobox's items and set IsEditable="True" so that the selection will be valid. You can

ComboBox DataBinding causes ArgumentException

廉价感情. 提交于 2020-01-13 10:11:53
问题 I several objects of class: class Person { public string Name { get; set; } public string Sex { get; set; } public int Age { get; set; } public override string ToString() { return Name + "; " + Sex + "; " + Age; } } and a class that has a property of type Person : class Cl { public Person Person { get; set; } } And I want to bind Cl.Person to combobox. When I try to do it like this: Cl cl = new cl(); comboBox.DataSource = new List<Person> {new Person{Name = "1"}, new Person{Name = "2"}};

Binding ComboBox ItemsSource does not work in WPF

大憨熊 提交于 2020-01-13 09:48:11
问题 This is kinda strange cause every example I found there says I'm doing things the right way yet I was unable to get my ComboBox binding to work in WPF. I just created an empty WPF Application. public List<string> myCollection { get; set; } public MainWindow() { DataContext = this; InitializeComponent(); myCollection = new List<string> {"test1", "test2", "test3", "test4"}; } And here is my xaml for this: <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx

Use String list as source of Combo Box

依然范特西╮ 提交于 2020-01-13 08:59:27
问题 I wanted to use a String list as a source of various options in jComboBox in Java. Can you tell which method to use Thanks 回答1: See Below for my answer... take into account this is untested and merely an example. You need to create a custom implmentation of ComboBoxModel like Chandru said, Then set the ComboBoxModel on your JComboBox using the setModel() method and add elements using ((CustomComboBoxModel<String>)jComboBox.getModel()).add(listOfThings); Something like this: import java.util

VBA - close/unwrap/retract a combobox list?

有些话、适合烂在心里 提交于 2020-01-12 11:45:26
问题 I'm working on a dynamically filled Excel combobox (embeded in worksheet) But sometimes when I update the list inside while it's already "dropdown/unwrap", the display gets crazy. As I fill and check the list, I use these : to adjust the number of visible lines If .ListCount > 14 Then .ListRows = 15 Else .ListRows = .ListCount + 1 End If to display/unwrap the list (anyCB is an Object parameter in my Sub) anyCB.DropDown But sometimes, there is still 15 visible lines but a litlle slider inside

How to work with treecombo in Extjs 4.1

≯℡__Kan透↙ 提交于 2020-01-12 05:46:06
问题 I found tutor in http://www.sencha.com/forum/showthread.php?198856-Ext.ux.TreeCombo I try to make a treecombo in Extjs4.1 in http://jsfiddle.net/rq2ha/ here is my code Ext.onReady(function() { Ext.create('Ext.ux.TreeCombo', { margin:10, width:120, height: 10, treeHeight: 10, treeWidth: 240, renderTo: 'treecombo3', store: storeMenu, selectChildren: false, canSelectFolders: true ,itemTreeClick: function(view, record, item, index, e, eOpts, treeCombo) { var id = record.data.id; // I want to do

How to use Ext5 combobox with data bindings

纵然是瞬间 提交于 2020-01-12 05:45:06
问题 I want to use a combobox which receives the preselected value from a data binding and also the possible options from a data binding of the same store. The panel items configuration looks like this: { xtype: 'combobox', name: 'language_default', fieldLabel: 'Default Language', multiSelect: false, displayField: 'title', valueField: 'language_id', queryMode: 'local', bind: { value: '{database.language_default}', store: '{database.languages}' } } If I use this configuration, the store of the

Override DrawItem of ComboBox

与世无争的帅哥 提交于 2020-01-11 14:11:56
问题 I changed the highlight color of various of the controls, and I am planning to make more changes. So I though is better to create my own controls and reuse them instead of making the changed for each and every one of them. I created a new user control, and inherited from System.Windows.Forms.ComboBox . The problem is I cannot find a way to override onDraw like I would for onClick . So how I would go and override it? Here is the code I used for each control onDraw event public void

Need to customize combobox in javafx with xml data

回眸只為那壹抹淺笑 提交于 2020-01-11 11:22:28
问题 I need to display the javafx tree table with values read from XML file. I am able to do it as shown below, I am able to add color to the combo box as shown But when I collapse the tree the color which is set still remains the same, as shown here How can I change it back to normal? This is the piece of code I tried for changing color to the combobox where dojColumn is a column to display "Status" dojColumn.setCellFactory(new Callback<TreeTableColumn<TestSet, String>, TreeTableCell<TestSet,