combobox

How to update the values in a combobox triggered by another combobox?

落花浮王杯 提交于 2019-12-24 04:01:27
问题 I have 2 comboboxes in a form. I'd like the selected value in combobox1 to change when the list in combobox2 gets updated. For Example: ComboBox1 has names of mobile companies and ComboBox2 containing the list of all mobile phones of that company. 回答1: Assume you have a dictionary that associates phone models to their manufacturers: Dictionary<string, string[]> brandsAndModels = new Dictionary<string, string[]>(); public void Form_Load(object sender, EventArgs e) { brandsAndModels["Samsung"]

WPF Combobox Selected Item Error - Showing “System.Data.Entity.DynamicProxies”

拈花ヽ惹草 提交于 2019-12-24 03:40:24
问题 i've been through tons of attempts and forum posts but i still can't solve my issue. ISSUE A combobox displaying data from an entity framework dbcontext does not display the selected value but DOES work for the item list. The selected item just shows System.Data.Entity.DynamicProxies.Equipment_37EBC79AEAECCCCD132FD15F1C9172DF4DD402B322A9C5762AE640F03887F702 BUT the list of the combobox displays correctly.... SETUP I have a dbcontext that contains a class named equipment. Equipment has two

Show visible sheets in combobox

痴心易碎 提交于 2019-12-24 03:32:07
问题 Hi I have the following code to show worksheets in a combobox. Sheets are automatically added to the list when it's created. I do not want hidden sheet to be visible in the dropbox. How do I do that? Option Explicit Private Sub ComboBox1_Change() If ComboBox1.ListIndex > -1 Then Sheets(ComboBox1.Text).Select End Sub Private Sub Combobox1_DropbuttonClick() Dim xSheet As Worksheet On Error Resume Next Application.screenupdateing = False Application.EnableEvents = False If ComboBox1.ListCount <>

Strange behaviour of combobox in WinRT

谁说我不能喝 提交于 2019-12-24 03:15:20
问题 Comboboxes in WinRT have a default ItemsPanel of type CarouselPanel. This gives Windows 8.1 apps an "infinite loop" when scrolling combobox items. If you don't want this behaviour, there are a lot of blog posts explaining how to "fix it". For example this: Cancel WinRT ComboBox infinte scroll effect or: http://netitude.bc3tech.net/2013/04/12/windows-8s-combobox-and-the-carouselpanel/ The problem with this solution is that you get a weird behaviour on the first item in the combobox. How to

Very simple color picker made of combobox

走远了吗. 提交于 2019-12-24 03:06:08
问题 This is my xaml: <ComboBox Name="comboColors"> <ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Rectangle Fill="{Binding Name}" Width="16" Height="16" Margin="0,2,5,2" /> <TextBlock Text="{Binding Name}" /> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> And here is a population of combobox items in c#: comboColors.ItemsSource = typeof(Colors).GetProperties(); Now the question is - how to make this combo show its items in drop-down list 4-5-6 or

Combo box - typing selection then clicking out of focus - doesn't select the typed item

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:59:13
问题 I'm having an issue with the combo box. I have an event handler for OnClick which refreshes data based on what item was selected. The problem is when this scenario occurs: Drop-down the combo box to list the various options Type on the keyboard to find a matching item Combo box changes this selection and calls the OnClick event My screen refreshes due to this selection / event Click somewhere outside of the combo box to take the focus away from it Combo box goes back to the previous selection

How to change the foreground of selected ComboBoxItem with icon?

半世苍凉 提交于 2019-12-24 02:56:26
问题 I'm trying to change the foreground color of ComboBoxItem, however it doesn't work as expected. The default color for the foreground is black, and I want to set selected item foreground to white when opening the dropdown/popup. It works fine when the ComboBoxItem contains only text content. However when ComboBoxItem including non-plain text content is selected, the foreground remains white after closing the dropdown/popup. Xaml: <ComboBox HorizontalAlignment="Left" VerticalAlignment="Top"

Disable jQuery ComboBox when underlying DropDownList is disabled

五迷三道 提交于 2019-12-24 02:34:26
问题 I have converted a few DropDownLists to jQuery comboboxes to add auto complete functionality etc. however, there are various methods in the codebehind file to disable the drop down lists. This does not disable the jQuery combobox so the value can still be changed. Is there a way to bind the combobox to the dropdown list enable / disabled event? so they can update automatically based on the source drop down list? 回答1: Ok, I think I have come up with a solution by editing the js file for

selected item of comboBox in custom Delegate from QTableView

萝らか妹 提交于 2019-12-24 02:28:08
问题 I use a custom delegate to display a column of comboBoxes in my QTableView. The values are the same for all the comboBoxes so it's not really the population part that gives me trouble. I want them to show as the selected item, some value that I can retrieve from a database. I have access to the database from the delegate, but in order to send my request, I need the row of the comboBox. So I guess my question is : how can you iterate over all the rows of the table and do some action from

WPF Binding to Xml; how to extract selected XmlElement and cast to Object

寵の児 提交于 2019-12-24 02:16:28
问题 I have a WPF ComboBox bound to an Xml file and XmlDataProvider <ComboBox Canvas.Left="980" Canvas.Top="16" DisplayMemberPath="Name" FontSize="45" Height="76" SelectionChanged="comboBox1_SelectionChanged" Padding="10" ItemsSource="{Binding Source={StaticResource Sites}, XPath=Site}" Name="comboBox1" Style="{DynamicResource InfoKioskLargeStyledDropDown}" Width="600" /> My XML Looks as so: <Site> <Name>Campus Pride</Name> <Url>CampusPride</Url> <SlideCount>10</SlideCount> </Site> I then have an