combobox

Set Selected Item of WPF Combobox to User Setting

三世轮回 提交于 2019-12-24 09:38:19
问题 I have a combo box with an item source set as a collection of 'Category'. The SelectedValuePath is the CategoryID property. I have a user setting 'DefaultCategory' that is an integer of which should set the CategoryID. I want the combo box to have a selection of the DefaultCategory user setting. xmlns:my="clr-namespace:MyApp" <ComboBox x:Name="cmbCategory" DisplayMemberPath="Category" SelectedValuePath="CategoryID" SelectedValue="{Binding Source={x:Static my:MySettings.Default}, Path

How to get name of a List<string> from List<List<string>> to bind it dynamically? [closed]

不羁岁月 提交于 2019-12-24 09:14:35
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have a dynamic DataGrid in Which 1 column contains ComboBox template. Now I'll get 'N' number of comboboxes. Each ComboBox should have different ItemsSource. how can it be achieved? My dynamic datagrid has the property ItemsSourceBinding. Now I need to provide a DataContext

Populate Combobox with Two Text Fields from an Array

五迷三道 提交于 2019-12-24 08:58:56
问题 I'm trying to get values from 2 cells in an array to populate the text field of a combobox on a userform. The values in the array look like this: A 1 B 2 C 3 B 4 I would like to make a distinction between B2 and B4 in the combobox text field. The field currently populates like B . I would like it to populate with B 2 instead. This question is partly related to this question. I tried using this that was linked from here but couldn't get the ListCount property to work. I used this to better

Set cell vlookup value based on changing Combobox value

大兔子大兔子 提交于 2019-12-24 07:07:18
问题 I have input a combobox in an Excel sheet. I want it to work so that the user who does not have access to the VBA can select a value from the dropdown and then the value in another cell will perform a vlookup on this value. In the first instance I have inserted a box and am trying to set a cell value based on this. Sub InsertComboBox() #inserts dropdown box on the front page and sets the values as the list of DMA from the pipe_totals sheet #this should be the most complete list so will not

How to move my cursor to the left in in my ComboBox?

感情迁移 提交于 2019-12-24 07:06:51
问题 I would like to move my cursor to the start of the text in my ComboBox . This is what it looks like at the moment: I did try the following on the Closed Event : cboSomeCombo.Select(cboSomeCombo.Text.Length, 0); The cursor still stays all the way to the right. 回答1: This seems to be related: How to set the selected text of combobox align left 来源: https://stackoverflow.com/questions/5456976/how-to-move-my-cursor-to-the-left-in-in-my-combobox

The .NET CF ComboBox doesn't have a DropDown event, so what's the alternative?

旧街凉风 提交于 2019-12-24 07:04:23
问题 I'm working on a .NET 3.5 SmartDevice project and I could really use the ComboBox DropDown event, but the .NET Compact Framework version doesn't have it. Is there another way to be made aware of when the list has dropped down? 回答1: I use the GotFocus event to populate the combobox. I keep a boolean variable specifying wether the combobox is populated so it doesn't repopulate the combobox everytime it get's focus. it's a bit ugly, but it works... 回答2: Why would you need to know when they

Error when binding WPF combobox ItemsSource to an Array of Strings

最后都变了- 提交于 2019-12-24 06:45:49
问题 I could not set a combobox's ItemsSource to an Array. I have tried setting the DataContext to the class where the Array is found, and then setting the bindings in XAML class Car { public string[] makes; } ... public MainWindow() { Car _Car = new Car(); _Car.makes = new string[] { "Toyota", "Mitsubishi", "Audi", "BMW" }; this.DataContext = _Car; } and then in XAML <ComboBox Name="cars" Grid.Column="0" Grid.Row="0" Margin="5" ItemsSource="{Binding Path=makes}"/> It doesn't seem to do anything.

How to disable items in a combobox in Ext JS?

风流意气都作罢 提交于 2019-12-24 05:33:08
问题 How can I disable specific items in a combobox in Ext JS? For example I have these records row_1_type_1 row_2_type_2 row_3_type_3 and I want to disable the third row i.e it should stay in the combo as label but it will be greyed out and not clickable. 回答1: Here's a solutions that you can use at least for Ext JS 4.2.1. It's a plugin that disables some items in the boundlist based on the value of each record. The name of the field to check if the listitem should be disabled can be configured.

c# preventing custom combobox from autoselecting an item

喜你入骨 提交于 2019-12-24 05:18:26
问题 i am trying to implement my own ComboBox class in C# because, untill 3.5 NET Framework (if i'm not mistaking) suggestion lookup is made with a "StartWith" function (i.e. if the list contains "Doe, John" and user types "John", that item is not displayed). Basically i'm adding or removing items on text change event, getting them from the initial content of the list. Everything works pretty fine for what i am looking for, the only issue is, when ComboBox is clicked out, an item is still being

How to use combo box in c#

百般思念 提交于 2019-12-24 04:21:53
问题 I have no idea where to start. i tried DataTable but it didn't work.(This is an easy question :) ) I tried everything { var test = new DataTable(); test.Columns.Add("test"); test.TableName = "test"; test.Columns.Add("test"); comboBox1.DataSource = test.XXXX ; } 回答1: Assuming you mean winforms, something like: DataTable test = new DataTable(); test.TableName = "test"; test.Columns.Add("foo", typeof(string)); test.Columns.Add("bar", typeof(int)); test.Rows.Add("abc", 123); test.Rows.Add("def",