Menu
  • HOME
  • TAGS

How can I exclude .xlsb file types in my ComboBox?

excel,excel-vba,combobox

try With Me.ComboBox1 For Each wkb In Application.Workbooks If Not Right(wkb.Name, 4) = "xlsb" Then .AddItem wkb.Name End If Next wkb End With If you don't want to rely on the file extension being visible, you can check the file format instead. If Not wkb.FileFormat = 50 Then .AddItem wkb.Name...

Add default item to ComboBox while binding data with DataSet - WinForm

c#,.net,winforms,combobox

You have to add row in table this way: DataRow newRow = dataSet1.Tables[0].NewRow(); newRow["userID"] = 0; newRow["Username"] = "-Select a User-"; dataSet1.Tables[0].Rows.Add(newRow); and then give source to combo: ddlUsers.DataSource = dsUsers.Tables[0]; ddlUsers.ValueMember = "userID"; ddlUsers.DisplayMember = "Username"; For more information refer this MSDN article...

Invoke a ComboBox's enter key/action event handler regardless of value property change

java,combobox,javafx,javafx-8

As a general way of finding out how eventing works, you could always add an eventfilter with Event.ANY and see what happens, e. g.: comboBox.getEditor().addEventFilter(Event.ANY, e -> System.out.println(e)); The event gets fired, as can be seen in the console. So what you need is to add a filter for the...

How to retrieve name of dynamically created ComboBox in VBA?

excel,forms,vba,excel-vba,combobox

The easiest way to do this is to use the reference you get from the .Add method to name them. You're already looping through a range of values, so use the loop counter to build object names. This has the advantage of also having the names corresponding to row that...

Combo Box 1st item is remained empty in WPF c#

c#,combobox,wpf-controls

Try setting IsEditable and IsReadonly properties, like that: <ComboBox x:Name="opBox" IsEditable="True" IsReadOnly="True" HorizontalAlignment="Left" Text="Send/Receive"/> To stop your code from crashing on InitializeComponent() add the following code on top of opBox_SelectionChanged if (mySendButton==null||myReceiveButton==null) return; Also note that directly managing controls properties from event handlers is not WPF way. It's better to...

DropDown in datagridView

c#,visual-studio-2013,datagridview,combobox,ssms

thank you! i found the answer public Form1() { InitializeComponent(); load_input_table(); load_output_table(); dataGridView1.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(dataGridView1_EditingControlShowing); } static String conn = @"Data Source=SUMEET-PC\MSSQLSERVER1;Initial Catalog=EMIDS;Integrated Security=True"; SqlConnection connection = new SqlConnection(conn); DataGridViewComboBoxColumn inputtablecombobox = new DataGridViewComboBoxColumn(); private void load_input_table() { String sql = "select * from...

Java Combobox with Arraylist error

java,swing,combobox

Shouldn't (ComboBoxModel<ArrayList>) stations be stations? There doesn't seem to be a need for the cast Mind you... ArrayList stations = Reader(); JComboBox<ArrayList> cb = new JComboBox<ArrayList>((ComboBoxModel<ArrayList>) stations); Should probably be more like... ArrayList<String> stations = Reader(); JComboBox<String> cb = new JComboBox<>(); for (String value : stations) { cb.addItem(value); } or...

Duplicate output with ItemStateChanged listener on JComboBox [duplicate]

java,combobox,listener,netbeans-8

The solution is to get the stateChange from your event. if (evt.getStateChange() == ItemEvent.SELECTED) { System.out.println(mycombobox.getSelectedItem()); } The output is now unique....

Very simple color picker made of combobox

c#,wpf,combobox

In your .xaml <ComboBox Name="comboColors"> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <Grid Loaded="table_Loaded" /> </ItemsPanelTemplate> </ComboBox.ItemsPanel> <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 in your .xaml.cs ......

Can't retrieve and set a value in combobox inside ext.net gridpanel

extjs,combobox,ext.net,gridpanel

Add Bind listener to ComponentColumn. Look at this example: <%@ Page Language="C#" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <ext:ResourceManager ID="ResourceManager1" runat="server" ScriptMode="Debug" /> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { this.Store1.DataSource = this.Data; this.Store1.DataBind(); } } private object[] Data { get...

Binding Element to Property from Inherited Data Context

c#,wpf,xaml,combobox

Data binding in WPF works with public properties only, not with fields. Your item class should look like this: public class TwoStringClass { public string string1 { get; set; } public string colorHex { get; set; } } That said, there are widely accepted naming convention, according to which you...

How can I specify a column to fill an Excel Combobox?

excel,vba,excel-vba,combobox

You should be using the TextColumn property for setting which value gets shown to the user. The BoundColumn property sets which value your code gets when it reads the Value property of the control after the user has made a selection.

C# XAML - How to add a combobox to some datagrid ROWS but not others?

c#,wpf,xaml,datagrid,combobox

Try using a DataTrigger with predefined DataTemplate items: <DataTemplate x:Key="OneItem" DataType="{x:Type ValueItem}" > <TextBox Text="{TemplateBinding Id}" /> </DataTemplate> <DataTemplate x:Key="MultiItems" DataType="{x:Type ValueItem}" > <ComboBox ItemsSource="{TemplateBinding ValueItems}" DisplayMemberPath="ValueName" SelectedValuePath="ID" SelectedValue="{TemplateBinding Id}" /> </DataTemplate> And then use a Content control to place the style accordingly. I haven't tried this but your data...

Change data according to selected item in combobox

vb.net,combobox,populate

Yes ... but you need to put all of the code above into the SelectedValueChanged event for the ComboBox1 object.

Delphi ComboBox Access violation on combobox

delphi,ms-access,combobox,tadotable

Access Violation is raised most probably because you have forgot to instantiate your datamodule DataModule3. Verify this by calling Assigned function.

How to bind to a source inside a ListBox different from the ItemsSource already specified

c#,xaml,combobox,listbox

You can walk up the visual tree and bind to an ancestors datacontext: {Binding Path=PathToProperty, RelativeSource={RelativeSource AncestorType={x:Type typeOfAncestor}}} EX: {Binding Path=ListOfItems, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}} that should give you the datacontext that the listbox has, so assuming your ListOfItems exists in that data context. Or you can name your control, and...

Combobox Datasource assign to Datatable

vb.net,combobox,casting,datatable

I would use TryCast to get the job done. Dim dt As DataTable = TryCast(combobox1.DataSource, DataTable) If dt Is Nothing Then ' It didn't work because it's not a datatable ' Editors: I specifically did not reduce this expression ' to emphasize the need to check for 'Nothing' ' and...

Invoke Combobox from PHP in HTML

php,html,json,combobox

Make sure that the HTML page has the .php extension instead of .html and check if your webserver supports short open tag for php. Edit: You can check the phpinfo() if short_open_tag has the value on. Edit 2: You can access the selected value in your mailer.php with $_POST['Team1'] and...

Combobox not show the correct language values in struts1

forms,extjs,combobox,struts,struts-1

Check the response from server. Probably the request you are doing for loading combobox is probably returning Spanish data than english data. May be server is able to recognize the first request as right localization but for the next hit it is failing to detect. Share the code for store...

Combobox SelectedValue Returning System.Data.DataRowView even Converted to String

c#,winforms,combobox,dataset,datasource

As mentioned here and several other places, this happens if you don't specify the datasource after the display and value members. This is the correct order: DonorName.DisplayMember = "donor_name"; DonorName.ValueMember = "ID"; DonorName.DataSource = dt; ...

How to use multiple combo boxes to filter data in MS Access?

database,filter,combobox,ms-access-2007

I have done it. Here is the solution. I have made 4 combo boxes on my form as below and all fields from the Tasks table: Project Owner Name: Combo0 RowSource: SELECT [Owner List].[Owner ID], [Owner List].[Owner Name] FROM [Owner List]; Macro->Event->AfterUpdate: Requery -> Combo2 Requery -> Combo4 Requery ->...

Set ComboBoxCell in TableView JavaFX

combobox,javafx,tableview

The declaration of the Cell works fine, but the comboBox doesn't appear in the table. The combobox of ComboBoxTableCell will be appeared when this cell is in edit mode. To do that you need to set the tableview to editable and then double click the over mentioned cell. The...

Combobox and deleted record

c#,wpf,combobox

I'd propose a solution, based on ICollectionView filtering. View models: public class GroupViewModel { public string Name { get; set; } public bool IsDeleted { get; set; } } public class ItemViewModel { public ItemViewModel(List<GroupViewModel> groups) { Groups = new ListCollectionView(groups) { Filter = g => { var group =...

Selecting values from a combobox

php,jquery,mysql,combobox

You keep adding to the total without resetting any values so try this: var price=0; var pricex = 0; var pricey = 0; $(document).ready( function() { $('select[name=ticketType]').change( function(){ pricex = parseInt($(this).val()); price = pricex + pricey; $('#price').text(price); } ); } ); $(document).ready( function() { $('select[name=campingNumber]').change( function(){ pricey = parseInt($(this).val()); price...

dataChanged signal does not work with ComboBoxDelegate

c++,qt,combobox,qtableview,qstyleditemdelegate

The problem with your delegate implementation is that you do not emit commitData signal when the combo index is changed. It's stated in the Qt documentation : This signal must be emitted when the editor widget has completed editing the data, and wants to write it back into the model....

Difference between Combobox properties SelText and Text?

excel,vba,excel-vba,combobox

The difference is really given in the name (SelText vs. Text) where Sel stands for Selected. One is used to return or modify the selected text (i.e. SelText) and the other is used to return or modify the entire text (i.e. Text). If no text is selected in the ComboBox...

Reading c# combo box text and value?

c#,combobox

Your problem is that you should be defining item inside your for loop, as you're currently adding the same item to your ComboBox once for each result in your query, while also updating the item's text and value to match the current query result. At the end of the loop,...

In a continuous form, can I have a combo box use a different query depending on a field or text box value within its own record?

sql,vba,ms-access,combobox,access-vba

Yes, you can do it, but there's a tradeoff: inactive records may have a value which doesn't fit within the current rowsource for the combobox. When that happens, you'll get a blank combobox, instead of having it show the current value. If you activate the record, the value will appear...

Value ComboBox Change Value Of TextBox In C#

c#,winforms,combobox

I think you have a fault in your SqlDataAdapter: new SqlDataAdapter("select * from subscrbtion where id='" + comboBox1.Text + "'", cn); should be new SqlDataAdapter("select * from subscrbtion where id='" + comboBox1.SelectedValue + "'", cn); SelectedValue will point to the Id as you declared under ValueMember. Extra: set your combobox...

C# WPF How to modify the ComboBox's selected item's color?

c#,wpf,combobox

In the simplest case you can write this in XAML: <ComboBox ItemsSource="{Binding DropDowmItems}" Foreground="Red"> <ComboBox.ItemContainerStyle> <Style TargetType="{x:Type ComboBoxItem}"> <Setter Property="Foreground" Value="Black"/> </Style> </ComboBox.ItemContainerStyle> </ComboBox> In the case of item template, you need to modify that template. ...

Dynamically fill comboBox providers in Flex Datagrid

flex,combobox

Not sure how you are not getting an exception here but the testVals property should be an ArrayCollection to become a dataprovider and not an Array ? Try this, I'm pretty sure it should work: var itemOne:Object = {}; itemOne.valName = "Item one"; itemOne.testVals = new ArrayCollection(["one", "two"]); var itemTwo:Object...

Items not adding to ComboBox

c#,combobox

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { //some other code } private void Form_Load(object sender, EventArgs e) { int days = 31; for (int i = 1; i <= days; i++) { this.dayComboBox.Items.Add(i); } } SelectedIndexChanged never seems to be changing. Plus any time you change the index, you'll re-add...

Winforms comboboxes and parameterized stored procedure

c#,winforms,stored-procedures,combobox

I removed reader.Read and then call which advanced the position (and skipped one of my three records). Alternatively I could have used if (myReader.HasRows). private void FillCombobox2() { string S = ConfigurationManager // TSQL-Statement SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = ("SELECT DISTINCT Monat from tblSales"); //SqlDataReader...

Editable ComboBox binding and update source trigger

c#,wpf,binding,combobox

Your approach of updating the source in response to specific events is on the right track, but there is more you have to take into account with the way ComboBox updates things. Also, you probably want to leave UpdateSourceTrigger set to LostFocus so that you do not have as many...

How fill combobox using with enum - show integers(values) of enum in combobox

c#,winforms,combobox,enums

Cast them to their underlying values: cb_birates.DataSource = Enum.GetValues(typeof(BitRates)) .Cast<BitRates>() .Select(x => (int)x) .ToList(); ...

Combobox value (binded with an enum) in an instance

c#,combobox,enums

Just use the following: Lanes lane = (Lanes)cbRol.SelectedIndex; This works due to enum is typeof int, so your Top is actually 0, and so on......

How do you disable a jQuery UI Combobox?

combobox,jquery-ui-autocomplete

While this doesn't technically answer your specific question, I strongly urge you to spend a little time learning "Chosen." It's a JQuery plugin, and does most of what you're after. On top of that, learning a JQuery plugin is always a good idea. There's lots of other good ones out...

Populate Userform textbox based on cell selected by Combox

excel,vba,combobox,textbox,userform

This should get you started. It populates the forms combobox with your values(which you had already) and the Vlookup finds the currency associated with the values in the combobox. Double check that your ComboBox and TextBox Name property matches your code. Private Sub UserForm_Initialize() ComboBox1.List = Worksheets("Sheet1").Range("A23:A30").Value End Sub Private...

Access VBA Filtering a combo box list based on Date field

sql,vba,ms-access,combobox,access-vba

My guess is that you just need to quote the date you're trying to use. Dates in Access SQL need to be quoted with the # character. Try this: EquipmentID1.RowSource = _ "SELECT tblEquipment.Equipment, tblEquipment.UnavailableFrom " & _ "FROM tblEquipment " & _ "WHERE tblEquipment.UnavailableFrom >= #" & Me!EndDate &...

Why is the ampersand missing in Firemonkey combo?

delphi,combobox,firemonkey

This seems to be inbuilt behaviour that is likely leftover from the VCL's accelerator key handling. There does not seem to be a way to modify this behaviour with styles or options : procedure TTextControl.DoChanged; var TextStr: string; begin if Assigned(FITextSettings) then FITextSettings.TextSettings.BeginUpdate; try if Assigned(FITextSettings) then FITextSettings.TextSettings.Assign(ResultingTextSettings); TextStr :=...

ComboBox binding works only one way with Color property

wpf,binding,combobox

OK i found out what was wrong. It looks like getting the actual name from a color is not that simple. ToString returns the hex string, and not the actual color name. So I used the answer from http://www.blogs.intuidev.com/post/2010/02/05/ColorHelper.aspx to create the converter. public class ColorToStringConverter : IValueConverter { public...

How to get the appropriate ComboBox Tag

c#,wpf,combobox

If you see the Tag is setting for the combo box itself and not for its individual item. You can build a dictionary and use it as datasource of your combo box. Specify the value and display members of the combo box with dictionary key and value attributes Try modifying...

compare items of 2 comboboxes

combobox,javafx,javafx-8

Try combobox1.getItems().removeAll(combobox2.getItems()); ...

Problems with displaying an user selection from a Combobox in a Listbox

python,combobox,tkinter,listbox

The problem is that you are calling the get method before the user ever has a chance to select something from the menu. You need to get the value from inside orderZoom, after the user has been able to select something. def orderZoom(self): ... fechaentrega = self.datasel.get() ...

Conditional binding from view model to view in WPF using MVVM pattern

c#,wpf,xaml,mvvm,combobox

you have several options to implement this, but in my opinion the best is: Add a property to your Data Context, the will be called "FullName" or something. That will return: (Pseudo) if Projects count > 0 then return Name + '-' + ProjectName else return Name then bind DisplayMemberPath...

How to dynamically create Sharepoint ComboBoxes?

c#,date,combobox,sharepoint-2010

DropDownList ddlReturnDateMonth = new DropDownList(); ddlReturnDateMonth.CssClass = "dplatypus-webform-field-input"; ddlReturnDateMonth.Items.Add(new ListItem("Jan", "1")); ...

Need to 'BindingList' a member of a struct to a combobox

c#,winforms,combobox,bindinglist

Do this, perhaps in form constructor : comboBox.ValueMember = "EmployeeID"; comboBox.DisplayMember = "FullName"; comboBox.DataSource = ei; Then setup a selection change handler : private void comboBox_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cmb = (ComboBox)sender; var employeeId = (int)cmb.SelectedValue; // use the value to get more info... } ...

How to add items to ComboBox as tree list

c#,winforms,combobox,tree

ComboBox Items contains objects, which are pretty dumb. The first thing you should do is to create a class, maybe like this: class ComboItem { public string Text { get; set; } public int Level { get; set; } public ComboItem (string text, int level) { Text = text; Level...

How can I populate comboboxes from arrays?

c#,arrays,wpf,combobox,split

The variables array1 and array2 only exist inside your function scope. You meant to use cNames and cPhoneNumbers....

ComboBox style in universal app

c#,wpf,combobox,win-universal-app

Ok I solved it. According to this Nested styles in Universal Apps, styles works quite different in WinRT. I solved it by defining styles for windows desktop in its MainPage. For windows phone I put styles in resources of combo box's parent control and use it as static resource in...

Populate Userform combobox from a given range on a mac (excel 2011)

excel,combobox,populate,userform

I just found the answer with: Private Sub UserForm_Initialize() CurrencyList.List = Worksheets("mySheet").Range("A23:A30").Value End Sub My mistake was changing UserForm to the name of my specific userform (Details)...

JavaFX: Expand a ComboBox programmatically

java,combobox,javafx

After your stage is visible, simply use : comboBox.show(); If you want to add a event, before the stage is visible, you may use : primaryStage.setOnShown(event -> comboBox.show()); ...

Can I setup my dojo dijit form ComboButton to do a onClick or something similar when the user selects a value in the drop down list?

javascript,combobox,dojo,dijit.form

I think what you're looking for is the onChange event and not the onClick and you might be looking for a DropDownButton instead of a ComboButton but either way, onChange is the method you should be looking for. A good way to hook into the onChange method is to use...

Update and sort Qt ComboBoxes alphabetically

c++,qt,sorting,combobox

You're trying to use QComboBox's internal model as source model for proxy. This is not going to work because QComboBox owns its internal model and when you call QComboBox::setModel, previous model is deleted (despite you reset its parent). You need to create a separate source model. Conveniently, you can use...

Displaying certain items on a ComboBox

.net,vb.net,combobox

How about: Me.ComboxBoxGas1.DataSource = _gasConcList.Where(Function(x) x.InUse = True OrElse x.GasID = selectedGasID).ToList() where selectedGasID is the last gas calibration value....

How can i set the selected index with data from server to a combobox in a jqgrid

c#,jquery,.net,combobox,jqgrid

You don't posted enough details about what you do, but I guess that adding formatter: "select" to the column should solve the problem. The usage of async call in the formatter is absolutely wrong way. If you set already editoptions.value then formatter: "select" will uses the information and will decode...

Get value of a ComboBoxTableCell

combobox,javafx,tableview

The problem seems to be that you haven't set a cellValueFactory for that column, so there is no data associated with it. Thus when you call getCellData(...), which looks for the value of the cell, it (of course) returns null. Just set a cellValueFactory on your column that maps into...

Static ComboBox in VS LightSwitch

c#,combobox,visual-studio-lightswitch

Is there a specific reason this needs to be a custom control? You could just add a Local Property of type String by clicking Add Data Item and then setting up a Choice List. Add the Local Property String to your screen and then click Choice List in the Properties....

Remove Combobox winrt flayout heading

combobox,windows-runtime,styles,winrt-xaml

you can set PickerFlyoutBase.Title property of combobox to either with space or text of your choice. So it would be like: PickerFlyoutBase.Title= " " or PickerFlyoutBase.Title="Some text" ...

VAADIN: Why I can't set a converter to a ComboBox?

combobox,type-conversion,converter,vaadin7

Your code cannot be compiled because there is no setConverter() method available on class ComboBox that fits your custom converter. Let me explain how converters are used on select components and what is the idea behind the specific method signatures you find for setting converters on a ComboBox. ComboBox provides...

WiX: Install component based on ComboBox selection

combobox,wix,condition

The property needs to be public (upper-case) and the comparison needs to be done inside a CDATA. You could use the case-insensitive comparison ~=. <Component Id="ComponentRed" Guid="*" Directory="INSTALLFOLDER"> <File Id="R" Name="red.txt" Source="red.txt" /> <Condition> <![CDATA[OPTION~="Red"]]> </Condition> </Component> <Control Id="MyComboBox" Type="ComboBox" X="20" Y="140" Width="56" Height="17" Property="OPTION"> <ComboBox Property="OPTION"> <ListItem Text="Red" Value="Red"...

C# Forms Loading ComboBox Items on Startup

c#,combobox

No, this seems quite legit. You don't have to worry as this is the way all things get loaded in WinForms... This will block the UI thread for a short amount of time, but since your not going to load huge masses of something, you won't even notice it. When...

PyQT4: Adding combobox in Qtableview

combobox,pyqt,qt4,tableview

Does this need to be done using a QTableView or can you do it using a QTableWidget? Making the assumption that you can use the Widget vs the View, you can easily add a combobox (or any widget) to a cell. class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self,parent) self.table = QtGui.QTableWidget()...

Refreshing winform ComboBox datasource on closing a dialog form

c#,winforms,combobox

Execution of code in the first Form pauses when you show the second Form as a modal dialog. So just call fillDivisionsCmboBox() immediately after displaying the second Form, instead of in the Form.Activated event, and it'll run when the user closes the Form. private void btn_new_division_Click(object sender, EventArgs e) {...

Binding ComboBox SelectedValue to string disables the default SelectedValue wpf

c#,wpf,binding,combobox,selectedvalue

Try using string insted of ComboboxItem: MainWindow(XAML) <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <Grid> <ComboBox SelectedItem="{Binding SearchType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" > <sys:String>A</sys:String> <sys:String>B</sys:String>...

JavaFX disabled element styling

css,combobox,javafx

The disabled property cascades from a scene graph node to its child nodes, so all the child nodes of the combo box effectively pick up their :disabled CSS styles. So, for example, the Label displaying the selected item uses its disabled style, which has opacity set to 0.4. To achieve...

Display blank instead of first item in combobox

c#,.net,winforms,combobox

After you have set items as the DataSource: cmbItemType.SelectedIndex = -1; ...

How can I show 2 columns in a combobox? (multiple values)

c#,combobox

DisplayMember and ValueMember properties will be your friends in this case. Please avoid selecting all the fields from the table just to fill your combobox. You can just do something like, da = new SqlDataAdapter("SELECT (name + ' - ' + CONVERT(varchar,klantId)) AS dispValue, klantId FROM LOGIN WHERE RECHTEN=2", conn);...

WPF ComboBox.ItemsSource goes into loop if data returned outside of Initialised

wpf,vb.net,combobox

Moving the reload sub to the end of the adding the new contact sub did the trick. Apart from anything else selecting a new value from any ComboBox causes the TabController.SelectionChanged event to fire each time

Bind TextBox to ComboBox in Access

vba,ms-access,combobox

Here's an example to get you started, though you should probably want to add some additional things like validation checks and whatnot. Firstly your form should be bound to that table you supplied us with so it makes it easier to update the data in that table. I called your...

Cant bind enum to combobox wpf mvvm

c#,wpf,mvvm,combobox,enums

You are trying to bind to a private variable, instead, your enum should be exposed as a Property. public IEnumerable<StrategyTypes> StrategyTypes { get { return Enum.GetValues(typeof(StrategyType)).Cast<StrategyType>(); } } Also, Discosultan has already solved another problem for you....

Why does tkinter.ttk Combobox clear displayed value on initial selection only?

python,python-3.x,combobox,tkinter,ttk

At one point in your code self.combovar points to an instance of a StringVar, but later you redefine self.combovar to be a string. The solution is to not redefine self.combovar inside newselection

Code not following sequential order in source

c#,ms-access,combobox,oledbconnection

You don't need to use a dataset, a datatable is more sutable for this: DataTable dt= new DataTable(); ... adapter.Fill(dt); and the binding will to the datatable directly, so you can avoid datasets whenever possible as they are more heavy objects: this.cmbo_divisions.DataSource = dt; ...

VBA - Userform - Combobox - Select Workbook/Sheet

excel-vba,combobox

That is an incorrect way of working with objects. Is this what you are trying? Private Sub CommandButton1_Click() Dim ws As Worksheet Set ws = Workbooks(Cb_Wb.Value).Sheets(Cb_Ws.Value) ws.Range("X77:X84").Copy End Sub ...

Displaying a date field from the java DB in 3 combo boxes in a Jform(GUI)

java,sql,database,date,combobox

year_field.setSelectedItem(rs.getDate(4)); month_field.setSelectedItem(rs.getDate(4)); day_field.setSelectedItem(rs.getDate(4)); Well if the data in the database is a Date then you need to access the Date first: Date date = rs.getDate(4); Now most of the methods in the Date class are deprecated so you don't really want to use that class. Instead you can use a...

ExtJS 4 Cannot render values in combo inside grid (cell editor plugin)

javascript,extjs,combobox,extjs4

Ext.create('Ext.grid.Panel', { id: 'mygrid', width: 500, height: 200, title: 'Test Grid', //Here is my Store, it will handle the information store: Ext.create('Ext.data.JsonStore', { fields: ["TKTNUM", "ASSOCIATED_TICKETS", "DEFAULT_TKT"], data: [{ "TKTNUM": 123, "ASSOCIATED_TICKETS": [{ "ASSOC_TKT_VAL": "XY", "AGE": 2 }, { "ASSOC_TKT_VAL": "AB", "AGE": 3 }], "DEFAULT_TKT": "XY" }, { "TKTNUM": "234",...

How can I filter through a table using a ComboBox?

combobox,sapui5,sapui

I figured it out. I used a DropdownBox instead and used the following code: oDropDown.attachChange(function () { oTable.getBinding("rows").filter(new sap.ui.model.Filter("payment", sap.ui.model.FilterOperator.EQ, oDropDown.getValue())); }); ...

C# ComboBox SelectedItem.toString() not returning expected results

c#,combobox,treeview

Well, well... maybe something like the following. Access the combo's data source, which is a DataTable, and extract selected row and column value using selected index. Maybe add some error handling, too. private void btn_add_Click(object sender, EventArgs e) { var data = cmbo_divisions.DataSource as DataTable; var row = data.Rows[cmbo_divisions.SelectedIndex]; var...

DataTrigger is not working

wpf,combobox,treeview,radio-button,custom-controls

In Datatrigger you are binding enum values as oridinary string. it should follow syntax as {x:Static namespace:ClassName+EnumName.EnumValue} Change your Datatrigger as <DataTrigger Binding="{Binding ElementName=radMateriais, Path=IsChecked, Mode=TwoWay}" Value="True"> <Setter Property="TipoTreeP" Value="{x:Static my:TipoTree.Materials}"/> </DataTrigger> ...

Show value based on selection in combo box vba

vba,ms-access,text,combobox

That code should work fine. You want to put it in the combobox on change event. Also added an elseif so there isnt multiple if and end ifs. Put that code in in the userform that has the combo box. So your code will look like. Private Sub cmb_Main_Impact_Change() If...

ExtJS filter ComboBox dynamically

javascript,extjs,combobox

Each row in the grid is a model. So, in your leadDev combobox you just need to listen for 'expand' event, then retrieve current row model and apply value from this model to the filter. It should look like this(not checked): Ext.create('Ext.form.ComboBox', { store: store queryMode: 'local', displayField: 'personName', valueField:...

Winform Combobox with DataSource as List

c#,winforms,combobox,datasource

The problem does not occur because you have a list of integers, that occurs because you probably add items to the list after assigning it to the DataSource property. List does not have a mechanism to notify it's container when items are added to it or removed form it. Either...

Dataset Loading a WPF Combobox

c#,wpf,combobox

Derived from this example, you'll want to work with the ItemSource, DisplayMemberPath, and SelectedValuePath properties: IDComboBox.ItemsSource = dataSet.Tables[0].DefaultView; IDComboBox.DisplayMemberPath = dataSet.Tables[0].Columns["ID"].ToString(); IDComboBox.SelectedValuePath = dataSet.Tables[0].Columns["ID"].ToString(); And in xml: <ComboBox Name="IDComboBox" ItemsSource="{Binding}"/> ...

Restricting the input in DataGridView c#

c#,datagridview,combobox

When you create the columns, create them each as a DataGridViewComboBoxColumn. As you stated: [You] know the expected values for each column Therefore you can create the columns this way with each column's source bound. For example: public Form1() { InitializeComponent(); List<List<string>> options = new List<List<string>>() { new List<string>() {...

I'm retrieving a value for a combobox with custom class items but I can't make it show the item

c#,winforms,combobox

First, override Equals and GetHashCode methods in your class: public class ComboBoxItem() { string displayValue; string hiddenValue; //Constructor public ComboBoxItem (string d, string h) { displayValue = d; hiddenValue = h; } //Accessor public string HiddenValue { get { return hiddenValue; } } public override bool Equals(object obj) { ComboBoxItem...

How do I make a quiz become graded via combo box results c#

c#,math,combobox

The max score can be is 5, and since this is smaller than 6. 5/6 will always be 0 in integer division.

How can I get the object value of a combobox in django view?

django,view,combobox

No, it is the primary key of the Person object in the database. So you can get it via Person.objects.get(pk=selected_person). But really you should be using a Django form, which will then give you the Person object via form.cleaned_data['person']. Also note, for clarity, this is a select field, or a...

How do you populate a Combobox based on the selection of another Combobox?

python-3.x,combobox,tkinter

Don't use global variables. Use class variables instead. Use dictionaries instead of multiple variables. Use ComboboxSelected event Result: from tkinter import * import tkinter.ttk category = {'home': ['utilities','rent','cable'], 'car': ['gas','oil','repairs'], 'rv':['parks','maintenance','payment']} class Application(Frame): def __init__(self, master=None, Frame=None): Frame.__init__(self, master) super(Application,self).__init__() self.grid(column = 5,row = 20,padx = 50,pady = 50)...

WPF - How to highlight a combobox border when focused

wpf,combobox,styles

Write your own style to highlight border and add as resource in FocusVisualStyle of Combobox.

Retrieve text from control

vb.net,visual-studio-2010,combobox

USING - Visual Studio (Visual Basic) I have made a simple window form. In it I added a combo box, editing ("Edit Items") it and adding a few fruits in there, of course without forgetting the random numbers after the colon. This I assume is a fair recreation of your...

Combobox and IDataErrorInfo

wpf,vb.net,mvvm,combobox,idataerrorinfo

Solved .. This is the solution Public Property USER() As String Get Return p_USER End Get Set(ByVal value As String) p_USER = value OnPropertyChanged("USER") OnPropertyChanged("User_USER") End Set End Property...

Combobox Validation Rule

c#,winforms,combobox

On ComboBox1_SelectedIndexChanged write code If ComboBox1.SelectedIndex = 0 Then 'Also take ComboBox1.SelectedItem='Yes' Panel1.Visible = True Else Panel1.Visible = False If RadioButton1.Checked = False Then Label1.Text="NULL" End If End If Pass Label Value to the database....