combobox

JavaFX ComboBox - Display text but return ID on selection

前提是你 提交于 2019-12-21 01:57:24
问题 I have a Database table with airports, each airport has a name and an ID. In JavaFX I have a form, with a ComboBox , the combobox needs to display all the airport names and when the form is submitted it needs to insert the ID of the airport into the database (not its name). But I'm not really figuring out what the solution is. I have a ObservableList vliegveldenList = FXCollections.observableArrayList(); ObservableList vliegveldenIDList = FXCollections.observableArrayList(); Database

Extjs - How to show combobox in Grid column

白昼怎懂夜的黑 提交于 2019-12-20 17:32:30
问题 I have a gridpanel include date and combo column jsfiddle But I don't want click to show my combo. I want show my combo without click, not hide inside cell like and the same for date column like I think chage to clicksToEdit: 0 but fail plugins: [ Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }) ] How to do that, thanks 回答1: The only way to achieve this in 4.2x or below is to use a custom component like Skirtle's comonent column http://skirtlesden.com/ux/component-column This

WPF - MVVM: ComboBox value after SelectionChanged

房东的猫 提交于 2019-12-20 12:42:48
问题 I am new to C# and MVVM, and I've spent all day trying to get the value of a ComboBox to my ViewModel on SelectionChanged . I have managed to figure it out using either CallMethodAction or InvokeCommandAction with the resources: System.Windows.Interactivity.dll Microsoft.Expression.Interactions.dll My problem is that both these methods return the value of the ComboBox before it has changed. Could anyone explain how to get the value after the change? I have spent hours searching through SO and

How to get the TEXT of Datagridview Combobox selected item?

十年热恋 提交于 2019-12-20 10:44:34
问题 How to get the Combobox selected item text which is inside a DataGridView? I have tried using the below code: dataGridView1.Rows[1].Cells[1].Value.ToString() But, this gives the value associated with this cell, not the Combobox selected item text. I also tried this: DataGridViewComboBoxCell cell = dataGridView1[1,1] as DataGridViewComboBoxCell; string value = cell.Value.ToString(); But, this also didn't help. I would appreciate your help. Thanks in advance! EDIT: Let's say, we have a Combobox

How do I set combobox read-only or user cannot write in a combo box only can select the given items? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-20 09:47:35
问题 This question already has answers here : How can I make a ComboBox non-editable in .NET? (5 answers) Closed 4 years ago . I am facing a problem in setting the combo property such that only user can select the values form given items, but I cannot write in the combo box. How can I do so in C#? 回答1: Just change the DropDownStyle to DropDownList . Or if you want it completely read only you can set Enabled = false , or if you don't like the look of that I sometimes have two controls, one readonly

How to populate a ComboBox based on another ComboBox using a connection string (SQL Server, VB.NET)

时光毁灭记忆、已成空白 提交于 2019-12-20 07:43:25
问题 When a user selects a client from combobox 1 (a company we do work with and are partners with), its supposed to populate the users from combobox 2 for that client only, which needs to come from that particular database in SQL Server. Example: The first Combobox with all the Clients when a user selects a client and the Second ComboBox with all the Users from that database only, I want the Users list of the Second ComboBox to change according to the Clients selected from the list of the first

Drop Down in VB.NET

北战南征 提交于 2019-12-20 07:24:19
问题 I have a small requirement and that is: There are two combo boxes on a form and for populating the employee names and roles. I am populating the combo boxes as follows: I have created a class called "DbConnect" and in that there are 02 functions as: Public Function getEmployees() As DataTable Dim employeeDS As New DataSet Dim employeeDA As New SqlDataAdapter("prc_emp_list", conn) employeeDA.Fill(employeeDS, "employees") Return employeeDS.Tables("employees") End Function Public Function

WPF Binding Combox with different List and different SelectedValue

落花浮王杯 提交于 2019-12-20 06:47:18
问题 In my UserControl ucStep2 I have DataContext of Step2InfoData object that has several properties along with : private string rockDensUnit; public string RockDensity_Unit { get { return rockDensUnit; } set { if (rockDensUnit != value) { rockDensUnit = value; Changed("RockDensity_Unit"); } } } In my app I got to bind several combo's with different normally measurement types Like {kg/m3, gm/m3}, {meter, cm} and so on such groups of measures. I mean, multiple combo's to have list of same items.

WPF change the background color of an edittable combobox in code

狂风中的少年 提交于 2019-12-20 06:40:01
问题 I need to set the background color of an editable combobox in code. This is what I have but does not change the color: ComboBox comboBox = sender as ComboBox; comboBox.Background = Brushes.PeachPuff; if (comboBox.IsEditable == true) { TextBox textBox = (TextBox)comboBox.Template.FindName("PART_EditableTextBox", comboBox); if (textBox != null) { textBox.Background = Brushes.PeachPuff; } } I was expecting the background color to change to PeachPuff (light orange) but nothing happens - any ideas

jquery autocomplete field that REQUIRES a selected value?

一世执手 提交于 2019-12-20 06:34:10
问题 I need some jquery plugin as they use it on most flight booking sites where you have to choose your departure/arrival airport from a combolist. i had a look around, but i could not really find any good solution. I need a autocomplete combobox that will stay open until the user chooses a item from a list of possible values, and it must support some hidden id numbers that will be send instead of the text - the plugins on jquery usually only send the text-value. Right now i use http://blog