combobox

Tooltip for each items in a combo box

孤街浪徒 提交于 2019-12-17 17:55:09
问题 I just want to add a tooltip for each item in a combo box. i am using c#.net windows application. There is no option like combobox.items[1].tooltip(); Is there any way to add tooltip it ? 回答1: There are actually a couple reasonable solutions to this question. An MSDN forum has a ComboBox Item highlight event post that contains two possibilities, one from nobugz and one from agrobler. Each of them provides code to subclass a ComboBox that is supposed to handle tool tips on individual items in

Grails: Load data on one ComboBox depending on another

本小妞迷上赌 提交于 2019-12-17 16:51:10
问题 Let's say I have a combobox with the options GENERAL, AIR, GROUND, and SEA <g:select name="group" from="${['GENERAL', 'AIR', 'GROUND', 'SEA']}" valueMessagePrefix="default.category" value="${tipoN}" /> And then another combobox that loads certain information depending whether you select GENERAL, AIR, GROUND, or SEA. Let's say GROUND has 3 options, FedEx, USPS, DHL , but AIR has complete different ones, AIRPLANE, JET, HOT AIR BALLOON . The name of the other <g:select> should be "commodity" I

What is the Swing-equivalent to HTML <optgroup>

杀马特。学长 韩版系。学妹 提交于 2019-12-17 16:44:39
问题 I want my JComboBox to group multiple options together, similar to the HTML optgroup: <select> <optgroup label="A"> <option/> <option/> </optgroup> </select> I could not find any solution for this in Swing. Manipulating the UI-Renderer for the Combobox seems to be a bad idea, as it's OS & L&F-dependent (and they are private so cannot extend). 回答1: Consider the following implementation as a basic guide how to apply custom styling and create non-selectable items: public class ExtendedComboBox

Can't add items to a combobox

喜欢而已 提交于 2019-12-17 16:41:55
问题 I have tried these sites for help: excel-easy.com sitestory.dk ozgrid.com stackoverflow.com contextures.com microsoft.com Would appreciate the help! Here is my code: Private Sub FusegearPerformanceUserForm1() With FailureComboBox .AddItem "japp" End With End Sub 回答1: So, just for completion: The solution to this question was, that the file was saved in the XLSX format which cannot contain VBA code. After saving the file in the XLSM format everything worked as expected. 回答2: Manipulation of

Extjs 4 combobox default value

我的未来我决定 提交于 2019-12-17 16:27:00
问题 I'm migrating my application from ExtJs 3 to 4 version. I have several comboboxes at my formPanel, and previously I've used hiddenName and all that stuff to submit valueField instead of displayField. All my adaptation works fine (value field IS submitting), but I can't set the default values for comboboxes, they are shown as empty after page load. Previously, I did that just with specifying the 'value' parameter in config. Is there any ideas how to fix that? My code - Model and Store: Ext

ComboBox binding to enum, what did I do wrong?

99封情书 提交于 2019-12-17 15:56:28
问题 I have searched around and it seems very easy to bind enums to combobox, just retrieve Enum values as a list of strings via an ObjectDataProvider from the static Enum.GetValues method, however i can't get it to work. The error is Type ContactExportType was not found. I have an enum called ContactExportType, it resides on Enums class. This class is part of the CEM.Marketing.Objects namespace. This is what i have: <UserControl xmlns:local="clr-namespace:CEM.Marketing.Objects" xmlns:sys="clr

Multiple item combo box with headers?

岁酱吖の 提交于 2019-12-17 15:42:24
问题 Is it possible to have "column headers" on a combo box bound to multiple items? For example a combo box that displays a persons name. The combo box would display John Doe. But I'd like to display column headers: First Last John Doe Jane Doe Jimmy Doe Is this possible without the use of a data grid? What about a simple solution that includes the use of a data grid? I found one solution for embedding a data grid into a combo box but it looks difficult and requires MS Blend. I'd be happy if I

custom combobox in wpf Application

妖精的绣舞 提交于 2019-12-17 15:40:08
问题 Im new to WPF Application. I need to customize my combobox like this image. I have tried this example http://www.eidias.com/Blog/2012/2/20/customizing-wpf-combo-box-style <Window x:Class="win.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" Background="Red"> <Window.Resources> <ControlTemplate x:Key="CustomToggleButton" TargetType="ToggleButton"> <Grid> <Border Name=

WPF Combobox DisplayMemberPath

眉间皱痕 提交于 2019-12-17 15:35:35
问题 Ok, I looked at other questions and didn't seem to get my answer so hopefully someone here can. Very simple question why does the DisplayMemberPath property not bind to the item? <ComboBox Grid.Row="1" Grid.Column="2" ItemsSource="{Binding PromptList}" DisplayMemberPath="{Binding Name}" SelectedItem="{Binding Prompt}"/> The trace output shows that it is trying to bind to the class holding the IEnumerable not the actual item in the IEnumerable. I'm confused as to a simple way to fill a

Auto-width of ComboBox's content

牧云@^-^@ 提交于 2019-12-17 15:35:33
问题 Does anybody know a way to set the ComboBox 's content's width to autosize I do not mean the ComboBox itself, just the opened content. 回答1: You can't use it directly. Do a trick First iterate through all items of your combobox, check for the width of every items by assigning the text to a label. Then, check width every time, if width of current item gets greater than previous items then change the maximum width. int DropDownWidth(ComboBox myCombo) { int maxWidth = 0; int temp = 0; Label