combobox

Problem with static data binding in wpf

Hi. I'm relatively new to wpf and I quite don't understand binding yet. I want to have several combo boxes in my application with the same items. The basic solution would be to copy paste but that just isn't good practice. So I thought to put a static resource with the content I want and bind all combo boxes to it. It compiles and runs ...

MVVM,WPF: How to set a item as selected in a combobox

It seems nobody has yet found a way to set the comboboxitem as selected with a SelectedItem="Binding Property". Is the solution to use a IsSelected Property in the ViewModel object within the combobox itemssource ? ...

Populating ComboBoxDataColumn items and values

I have a "populate combobox", and I'm so happy with it that I've even started using more comboboxes. It takes the combobox object by reference with the ID of the "value set" (or whatever you want to call it) from a table and adds the items and their respective values (which differ) and does the job. I've recently had the brilliant ide...

C# Set combo item with selectedValue

I am dynamically creating a combobox like this: public Control GenerateList(Question question) { // Get a list with answer possibilities List<QuestionAnswer> answers = question.GetAnswers(); // Get a collection of given answers Collection<QuestionnaireAnswer> givenAnswers = question.GetFilledAnswers(); ComboBox cmb...

How can I use a search button using JavaScript Triple Combo Box?

I am using this Cut & Paste Triple Combo script.. This does not have a search button next to it. How can I put a search button instead of direct select URL linking? Here is the double combo with Go button But the triple does not have a search button. How can I put a search button in that Triple Combo Script? Please provide all the cod...

Tips on creating my own Captivate widget from a Flash component?

I'm a reasonably-experienced Flash developer, now needing to use Captivate. In order to emulate some software functionality in an exercise, I need to create a combobox control (what Captivate calls a "widget" and Flash calls a "component"). The combobox that ships with Captivate is very different in appearance from the one I need to im...

WPFToolkit DataGrid: Combobox column does not update selectedvaluebinding immediately

I'm using WPF Toolkit DataGrid and DataGridComboBoxColumn. Everything works well, except that when selection change happens on the combobox, the selectedvaluebinding source is not updated immediately. This happens only when the combobox loses focus. Has anyone run into this issue and any suggestions solutions ? Here's the xaml for the ...

Combobox having values but not showing text

hi, I'm using GWT-EXT combobox. My problem is when I render the combobox, it's having as many rows as it has values but all the rows are empty means text is not shown. Here's my code. Combobox cb = new Combobox(); cb.setForceSelection(true); cb.setMinChars(1); cb.setWidth(200); cb.setStore(store); // Store is perfectly loaded in co...

Adjusting ComboBox DropDown Width in C#

Hello. I have this code that adjusts the width of a comboBox drop-down: private void comboBox_DropDown(object sender, EventArgs e) { ComboBox senderComboBox = (ComboBox)sender; int width = senderComboBox.DropDownWidth; Graphics g = senderComboBox.CreateGraphics(); Font font = senderComboBox.Font; int vertSc...

ComboBox SelectedItem vs SelectedValue

The following code works as you’d expect — MyProperty on the model is updated when the user picks a new item in the dropdown. comboBox1.DataBindings.Add("SelectedValue", myModel, "MyProperty", true, DataSourceUpdateMode.OnPropertyChanged); The following, however, doesn’t work the same way and the model update isn’t triggered until the...

.NET OwnerDraw ComboBox: Vista/7 themed DropDownList

I'm working on a custom ComboBox for a project, and have the basic painting working. One of the remaining things to do is make it look like the default ComboBox in Vista and 7, when the DropDownStyle is set to DropDownList (looks like a button instead of a regular ComboBox). I read much about VisualStyleRenderer, read ComboBox.cs and Co...

combobox inserting consecutive variables

Hi,I have a question about combobox.I use visual c# and I want to insert consecutive numbers (1 to 100) in combobox.How can I do this? ...

Can't use attached property on combobox inside hierarchical datatemplate WPF

I'm hoping to use an attached property to assign a command to the selection changed event of a combobox that is embedded inside a treeview. I'm attempting to set the attached property inside the hierchical data template for the tree but the command is not set and does not fire when the item in the combobox is changed. I've found that ...

Calculating ComboBox DropDownWidth in C#

In my application a ComboBox gets resized, so that it is smaller. How do I re-calculate the DropDownWidth property? I know how to set it, but I'd prefer to calculate the proper width because its contents changes. Preferabley, I was thinking of something along these lines: int iMaxLen = 0; foreach item in comboBoxList { iMaxLen = (...

Can a WPF ComboBox display alternative text when its selection is null?

G'day! I want my WPF ComboBox to display some alternative text when its data-bound selection is null. The view model has the expected properties: public ThingoSelectionViewModel : INotifyPropertyChanged { public ThingoSelectionViewModel(IProvideThingos) { this.Thingos = IProvideThingos.GetThingos(); } public Obser...

Adding a Combobox to a DataGrid in Silverlight

I can add a Combobox to a DataGrid using following xmal: <local:DataGridTemplateColumn Header="SomeHeader" Width="106" HeaderStyle="{StaticResource headerAlignRightStyle}" CellStyle="{StaticResource cellAlignRightStyle}"> <local:DataGridTemplateColumn.CellTemplate> <DataTemplate> ...

aspxcombobox populating on the fly

Aspxcombobox populating on the fly works fine with IE, but with others browsers, when using arrow keys for navigation, the second depended control, always has value for the first next and not for the current, so I have a bit of delay ... ...

.Net: Best technique to fill a number of combo boxes on the form in windows application?

hi Suppose that you have a win form with 5 combo boxes on it. Some one told me that you must have 5 data table in order to fill them one by one. It does not seem very logical and I think this will create ugly code. How do you fill them with data stored in Database? ...

How can I extend a ComboBox to support commands (MVVM)?

Hi, As topic says, I need to extend the features of a standard Silverlight ComboBox to also support Commanding. Since I follow MVVM I need my ComboBox to communicate the SelectionChanged event to my ViewModel. What would the code look like for doing this? I want to be able to put the Command attribute on my ComboBox XAML control. Usin...

Accessing parent-level controls from inside a ComboBox's child controls

I have XAML similar to this: <ListBox ItemsSource="{Binding SearchCriteria, Source={StaticResource model}}" SelectionChanged="cboSearchCriterionType_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Name="spCriterion" Orientation="Horizontal" Height="20"> <ComboBox Name="cboSearchCriterionType"...