combobox

Select ComboBox by value in winforms

…衆ロ難τιáo~ 提交于 2020-01-24 09:01:07
问题 How to select combo box by value in WinForms? I am setting combobox like that: ComboboxItem item = new ComboboxItem(); item.Text = "Test"; item.Value = 1; cmbComboBox.Items.Add(item); internal class ComboboxItem { public string Text { get; set; } public object Value { get; set; } public override string ToString() { return Text; } } I need to select where Value = 1 回答1: Because ObjectCollection does not implement the generic IEnumerable<T> only IEnumerable you can't use LINQ standard query

Tkinter how to update second combobox automatically according this combobox

ε祈祈猫儿з 提交于 2020-01-23 17:39:08
问题 I have encountered an issue with combobox updates in Tkinter Python. I have two comboboxes: combobox A with values =['A','B','C'] and combobox B What i want is that: when value A is selected in combobox A then in combobox B show the values ['1','2','3'] when value B is selected in combobox A then in combobox B show the values ['11','12','13'] when value C is selected in combobox A then in combobox B show the value s ['111','112','113'] Currently part of my code as follows: def CallHotel(*args

ExtJS 4 - How to display template having width greater than the width of combo-box?

自闭症网瘾萝莉.ら 提交于 2020-01-23 16:17:40
问题 I have a combo-box in which the values are being displayed in a template. Now, I want the width of the template to be more than that of combo-box and hence I am using matchFieldWidth:false as mentioned at the link - ExtJS ComboBox dropdown width wider than input box width? But when I do so, then in the list of values there is no scrollbar displayled due to which the user is able to see only the first two values. The complete list gets displayed as soon as matchFieldWidth:false is removed, but

ExtJS 4 - How to display template having width greater than the width of combo-box?

落爺英雄遲暮 提交于 2020-01-23 16:16:47
问题 I have a combo-box in which the values are being displayed in a template. Now, I want the width of the template to be more than that of combo-box and hence I am using matchFieldWidth:false as mentioned at the link - ExtJS ComboBox dropdown width wider than input box width? But when I do so, then in the list of values there is no scrollbar displayled due to which the user is able to see only the first two values. The complete list gets displayed as soon as matchFieldWidth:false is removed, but

Windows Form - How add header not selectable in combobox item in C#?

痴心易碎 提交于 2020-01-23 11:06:32
问题 I need create a custom combobox control that allows header as separator which should not be selectable using the mouse move or key press. this is example: Header1 item1 item2 item3 Header2 item4 item5 I tried many solutions, without success. Thanks in advance! 回答1: Once again, WPF can easily provide solutions that would require tons of horrible hacks in winforms. Copy and paste my code in a File -> New Project -> WPF Application in Visual Studio. You will quickly notice that my solution not

Windows Form - How add header not selectable in combobox item in C#?

浪尽此生 提交于 2020-01-23 11:06:13
问题 I need create a custom combobox control that allows header as separator which should not be selectable using the mouse move or key press. this is example: Header1 item1 item2 item3 Header2 item4 item5 I tried many solutions, without success. Thanks in advance! 回答1: Once again, WPF can easily provide solutions that would require tons of horrible hacks in winforms. Copy and paste my code in a File -> New Project -> WPF Application in Visual Studio. You will quickly notice that my solution not

COMBOBOX filtering in WPF with MVVM

安稳与你 提交于 2020-01-23 02:09:05
问题 I am developing an application using WPF mvvm approach. I have a requirement where I have to show a list of items in a combo box for selection. Based on some flag I need to filter out few items from the combo box for selection. I tried to use two different items sources one with full list and another with filtered list and based on the flag I wanted to change the items source. This does not seem to be working well. Is there any easy way to apply filters on the existing list based on some flag

COMBOBOX filtering in WPF with MVVM

醉酒当歌 提交于 2020-01-23 02:08:27
问题 I am developing an application using WPF mvvm approach. I have a requirement where I have to show a list of items in a combo box for selection. Based on some flag I need to filter out few items from the combo box for selection. I tried to use two different items sources one with full list and another with filtered list and based on the flag I wanted to change the items source. This does not seem to be working well. Is there any easy way to apply filters on the existing list based on some flag

Why this UWP ComboBox can be blank after initialization but works fine for selection?

一笑奈何 提交于 2020-01-21 09:02:05
问题 I have a ComboBox like this <ComboBox Grid.Column="1" Padding="5,0,0,0" DisplayMemberPath="Description" SelectedItem="{Binding MaxXXAge, Mode=TwoWay, Converter={StaticResource MaxXXAgeToMaxXXAgeMemberConverter}}" ItemsSource="{Binding ElementName=SettingsXXScrollViewer, Path=DataContext.MaxXXAgeMemberGroup, Mode=OneWay}" /> However, after initialization, the combobox is blank. It actually works fine after this. I can select and show the selected item as expected. It's just the first glance

C# How to set the autopostback property when using asp.net mvc?

依然范特西╮ 提交于 2020-01-21 02:36:10
问题 I am using asp.net MVC framework. On my page i have a dropdwonbox and when an option is clicked i want to go to another page. But i can't find how/where to set the autopostback property to true. This is the code i'm using: Aspx: <%= Html.DropDownList("qchap", new SelectList( (IEnumerable)ViewData["qchap"], "Id", "Title" )) %> Controller: public ActionResult Index(int id) { Chapter c = new Chapter(); ViewData["qchap"] = c.GetAllChaptersByManual(id); return View(); } What do i have to do to use