Search Results

Search found 931 results on 38 pages for 'combobox'.

Page 2/38 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • ExtJs combobox dispalyfield with hyperlink

    - by abhishek
    I want combobox displayfield value with hyperlink. The selected combobox value should display with a hyperlink, if I click that selected combobox value then it will open in a new tab. var multiComboMap = Ext.create('Ext.form.field.ComboBox', { fieldLabel: 'Select multiple states', renderTo: 'combo-map', multiSelect: true, //disabled: true, displayField:'locationMap', valueField:'locationId', id:'combo-map', width: 500, labelWidth: 130, emptyText: 'To view map select it', store: Ext.create('Ext.data.Store', //get data for the combobox { fields: [ { name: 'locationId', type: 'int' },{ name: 'locationName', type: 'string' },{ name: 'locationMap', type: 'string' } ], proxy: { type: 'ajax', //url: '../data/users.asp', url: '/AOP_MEETING/venueMaster.json', reader: { type: 'json', root: 'venueMasterc' } }, autoLoad: true }), triggerAction:'all', mode:'local', typeAhead: true, lastQuery:'' }); Thanks in advance.

    Read the article

  • WPF MVVM ComboBox SelectedItem or SelectedValue not working

    - by cjibo
    Update After a bit of investigating. What seems to be the issue is that the SelectedValue/SelectedItem is occurring before the Item source is finished loading. If I sit in a break point and weight a few seconds it works as expected. Don't know how I'm going to get around this one. End Update I have an application using in WPF using MVVM with a ComboBox. Below is the ViewModel Example. The issue I'm having is when we leave our page and migrate back the ComboBox is not selecting the current Value that is selected. View Model public class MyViewModel { private MyObject _selectedObject; private Collection<Object2> _objects; private IModel _model; public MyViewModel(IModel model) { _model = model; _objects = _model.GetObjects(); } public Collection<MyObject> Objects { get { return _objects; } private set { _objects = value; } } public MyObject SelectedObject { get { return _selectedObject; } set { _selectedObject = value; } } } For the sake of this example lets say MyObject has two properties (Text and Id). My XAML for the ComboBox looks like this. XAML <ComboBox Name="MyComboBox" Height="23" Width="auto" SelectedItem="{Binding Path=SelectedObject,Mode=TwoWay}" ItemsSource="{Binding Objects}" DisplayMemberPath="Text" SelectedValuePath="Id"> No matter which way I configure this when I come back to the page and the object is reassembled the ComboBox will not select the value. The object is returning the correct object via the get in the property though. I'm not sure if this is just an issue with the way the ComboBox and MVVM pattern works. The text box binding we are doing works correctly.

    Read the article

  • WPF ComboBox binding

    - by Budda
    Here is peace of the XAML code from my page: <ComboBox Grid.Row="2" Grid.Column="1" Name="Player2" MinWidth="50" ItemsSource="{Binding PlayersTest}" DisplayMemberPath="ShortName"> custom object is binded to the page data context: page.DataContext = new SquadViewModel(); Here is part the source code of 'SquadViewModel' class: public class SquadViewModel { public SquadViewModel() { PlayersTest = new ObservableCollection<SostavPlayerData>(); PlayersTest.Add(new SostavPlayerData { ShortName = "A. Sereda", }); PlayersTest.Add(new SostavPlayerData { ShortName = "D. Sereda", }); } public readonly ObservableCollection<SostavPlayerData> PlayersTest; public string TestText { get { return "Binding works perfectly!"; } } } As a result ComboBox should display a list of objects, but it is empty. Do you know why and how to get this list? Thank you. P.S. I've tried another XAML markup <ComboBox Grid.Row="1" Grid.Column="1" Name="Player1" MinWidth="50" ItemsSource="{Binding PlayersTest}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding ShortName}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> It doesn't work also, but binding to simple text block: <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding TestText}"/> Works perfectly.

    Read the article

  • Binding a WPF ComboBox to a different ItemsSource within a ListBox DataTemplate

    - by tjans
    I have a ListBox that contains a textbox and a combobox in its datatemplate: <ListBox Height="147" Margin="158,29,170,0" Name="PitcherListBox" VerticalAlignment="Top" ItemsSource="{Binding SomeCollectionOfObjects}" Background="Black"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBox Text="{Binding Path=Name}" /> <ComboBox ItemsSource="{Binding LocalArrayOfIntsProperty}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> I want to bind the listbox to a collection of objects (which I've done successfully), but I want the combobox in the above datatemplate to have its itemssource set to a local property on the window (array of ints). I still want the combobox to have a two-way bind between its selected item and a property on the collection of objects... I have the following in code: PitcherListBox.DataContext = this; Basically in the end, I want the combobox within the listbox to have a different itemssource than the listbox itself. I can't seem to figure out how to change the ComboBox's ItemsSource in XAML. Can someone provide me some feedback? Thanks!

    Read the article

  • Databinding combobox selected item to settings

    - by Tuukka
    I store user specified settings using application settings properties and databinding. It has been working fine, until i want user selected to font for combobox. Databinding between user settings and combobox not working. I want to store font family name. App.XML <Application.Resources> <ResourceDictionary> <properties:Settings x:Key="Settings" /> </ResourceDictionary> </Application.Resources> Window.XML <ComboBox Name="Families" ItemsSource="{x:Static Fonts.SystemFontFamilies}" <!-- This line --> SelectedItem="{Binding Source={StaticResource Settings}, Path=Default.Font, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="57,122,199,118"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding}" FontFamily="{Binding}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> Settings: font String User Arial

    Read the article

  • WPF data-bound ComboBox only shows first item of ItemsSource list

    - by Mark
    Hi all, I'm sure I'm doing something stupid but for the life of me I can't think of right now. I have a ComboBox that is data-bound to a list of Layout objects. The list is initially empty but things are added over time. When the list is updated by the model the first time, this update reflects properly in the ComboBox. However, subsequent updates never show up in the ComboBox even though I can see that the list itself contains these items. Since the first update works, I know the data-binding is OK - so what am I doing wrong here? Here's the XAML (abridged): <Grid HorizontalAlignment="Stretch"> <ComboBox ItemsSource="{Binding Path=SavedLayouts, diagnostics:PresentationTraceSources.TraceLevel=High}" DisplayMemberPath="Name" SelectedValuePath="Name" SelectedItem="{Binding LoadLayout}" Height="25" Grid.Row="1" Grid.Column="0"></ComboBox> </Grid> And the related part of the model: public IList<Layout> SavedLayouts { get { return _layouts; } } public Layout SaveLayout( String data_ ) { Layout theLayout = new Layout( SaveLayoutName ); _layouts.Add( theLayout ); try { return theLayout; } finally { PropertyChangedEventHandler handler = PropertyChanged; if( handler != null ) { handler( this, new PropertyChangedEventArgs( "SavedLayouts" ) ); } } } And finally, the layout class (abridged): public class Layout { public String Name { get; private set; } } In the output window, I can see the update occurring: System.Windows.Data Warning: 91 : BindingExpression (hash=64564967): Got PropertyChanged event from TickerzModel (hash=43624632) System.Windows.Data Warning: 97 : BindingExpression (hash=64564967): GetValue at level 0 from TickerzModel (hash=43624632) using RuntimePropertyInfo(SavedLayouts): List`1 (hash=16951421 Count=11) System.Windows.Data Warning: 76 : BindingExpression (hash=64564967): TransferValue - got raw value List`1 (hash=16951421 Count=11) System.Windows.Data Warning: 85 : BindingExpression (hash=64564967): TransferValue - using final value List`1 (hash=16951421 Count=11) But I get do not get this 11th item in the ComboBox. Any ideas?

    Read the article

  • Using Linq to filter a ComboBox.DataSource ?

    - by Pesche Helfer
    Hi board, in another topic, I've stumbled over this very elegant solution by Darin Dimitrov to filter the DataSource of one ComboBox with the selection of another ComboBox: how to filter combobox in combobox using c# combo2.DataSource = ((IEnumerable<string>)c.DataSource) .Where(x => x == (string)combo1.SelectedValue); I would like to do a similar thing, but intead of filtering by a second combobox, I would like to filter by the text of a TextBox. (Basically, instead of choosing from a second ComboBox, the user simply enters his filter in to a TextBox). However, it turned out to be not as straight forward as I had hoped it would be. I tried stuff as the following, but failed miserably: cbWohndresse.DataSource = ((IEnumerable<DataSet>)ds) .Where(x => x.Tables["Adresse"].Select("AdrLabel LIKE '%TEST%'")); cbWohndresse.DisplayMember = "Adresse.AdrLabel"; cbWohndresse.ValueMember = "Adresse.adress_id"; ds is the DataSet which I would like to use as filtered DataSource. "Adresse" is one DataTable in this DataSet. It contains a DataColumn "AdrLabel". Now I would like to display only those "AdrLabel", which contain the string from the user input. (Currently, %TEST% replaces the textbox.text.) The above code fails because the lambda expression does not return Bool. But I am sure, there are also other problems (which type should I use for IEnumerable? Now it's DataSet, but Darin used String. But how could I convert a DataSet to a string? Yes, I am as much newbyish as it gets, my experience is "void", and publicly so. So please forgive me my rather stupid questions. Your help is greatly appreciated, because I can't solve this on my own (tried hard already). Thank you very much! Pesche P.S. I am only using Linq to achieve an uncomplicated filter for the ComboBox (avoiding a View). The rest is not based on Linq, but on oldstyle Ado.NET (ds is filled by an SqlDataAdapter), if that's of any importance.

    Read the article

  • WPF Combobox: Autocomplete

    - by user279244
    Hi, I have implemented a Autocomplete enabled Combobox in WPF. It is like below... private void cbxSession_Loaded(object sender, RoutedEventArgs e) { cbxSession.ApplyTemplate(); TextBox textBox = cbxSession.Template.FindName("PART_EditableTextBox", cbxSession) as TextBox; textBox.IsReadOnly = false; if (textBox != null) { textBox.KeyUp += new KeyEventHandler(textBox_KeyUp); textBox.KeyUp += delegate { ///open the drop down and start filtering based on what the user types into the combobox cbxSession.IsDropDownOpen = true; cbxSession.Items.Filter += a => { if (a.ToString().ToUpper().Contains(textBox.Text.ToUpper())) return true; else return false; }; }; } } void textBox_KeyUp(object sender, KeyEventArgs e) { if ((e.Key == System.Windows.Input.Key.Up) || (e.Key == System.Windows.Input.Key.Down)) { e.Handled = true; } else if (e.Key == System.Windows.Input.Key.Enter) { e.Handled = true; cbxSession.IsDropDownOpen = false; } } void textBox_KeyDown(object sender, KeyEventArgs e) { cbxSession.SelectionChanged -= cbxSession_SelectionChanged; if (e.Key == System.Windows.Input.Key.Enter) { e.Handled = true; cbxSession.SelectionChanged += cbxSession_SelectionChanged; } if ((e.Key == System.Windows.Input.Key.Up) || (e.Key == System.Windows.Input.Key.Down)) { e.Handled = true; } } private void cbxSession_DropDownClosed(object sender, EventArgs e) { if (cbxSession.Text != "") { TextBox textBox = cbxSession.Template.FindName("PART_EditableTextBox", cbxSession) as TextBox; if (!cbxSession.Items.Contains(textBox.Text)) { textBox.Text = cbxSession.Text; } } } private void cbxSession_DropDownOpened(object sender, EventArgs e) { cbxSession.Items.Filter += a => { return true; }; } <ComboBox x:Name="cbxSession" Width="260" Canvas.Top="5" Canvas.Left="79" Height="25" Visibility="Visible" SelectionChanged="cbxSession_SelectionChanged" MaxDropDownHeight="200" IsTextSearchEnabled="False" IsEditable="True" IsReadOnly="True" Loaded="cbxSession_Loaded" DropDownClosed="cbxSession_DropDownClosed" StaysOpenOnEdit="True" DropDownOpened="cbxSession_DropDownOpened"> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel IsVirtualizing="True" IsItemsHost="True"/> </ItemsPanelTemplate> </ComboBox.ItemsPanel> </ComboBox> But, the problem I am facing is... When I try searching, the first character goes missing. And this happens only once. Secondly, When I am using Arrow buttons to the filtered items, the ComboboxSelectionChanged event is fired. Is there any way to make it fire only on the click of 'Enter'

    Read the article

  • WinForms ComboBox DropDown and Autocomplete window both appear

    - by Clyde
    I've got a combobox on a winforms app with this code: comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems; DataTable t = new DataTable(); t.Columns.Add("ID", typeof(int)); t.Columns.Add("Display", typeof(string)); for (int i = 1; i < 2000; i++) { t.Rows.Add(i, i.ToString("N0")); } comboBox1.DataSource = t; comboBox1.ValueMember = "ID"; comboBox1.DisplayMember = "Display"; I then follow these steps when the window opens: Click the combobox drop down button -- this displays the list of items and selects the text in the combobox Type '5', '1' ... i.e. I'm looking to use autocomplete to search for 515, 516, etc. You'll see that the autocomplete window now appears ON TOP of the drop down list. However if I mouse over, it's the obscured drop down window behind the autocomplete window that's receiving the mouse events, including the click. So I think I'm clicking on an autocomplete item but actually clicking on something totally random that I can't see. Is this a bug in the ComboBox? I'm using Windows 7 if that matters. Am I configuring the ComboBox wrong somehow? Note also that using the KEYBOARD uses the autocomplete drop down. So up/down arrow keys are using the front window, but the mouse is using the back window.

    Read the article

  • WPF derived ComboBox SelectedValuePath issue

    - by opedog
    In our application we have a very large set of data that acts as our data dictionary for ComboBox lists, etc. This data is staticly cached and keyed off of 2 variables, so I thought it wise to write a control that derived from ComboBox and exposed the 2 keys as DPs. When those 2 keys have proper values I set the ItemsSource of the ComboBox automatically from the data dictionary list it corresponds to. I also automatically set the SelectedValuePath and DisplayMemberPath to Code and Description, respectively. Here's how an example of how an item in the ItemsSource from the data dictionary list always looks: public class DataDictionaryItem { public string Code { get; set; } public string Description { get; set; } public string Code3 { get { return this.Get.Substring(0, 3); } } } The value of Code is always 4 bytes long, but sometimes I only need to bind 3 bytes of it. Hence, the Code3 property. Here's how the code looks inside my custom combobox to set the ItemsSource: private static void SetItemsSource(CustomComboBox combo) { if (string.IsNullOrEmpty(combo.Key1) || string.IsNullOrEmpty(combo.Key2)) { combo.ItemsSource = null; return; } List<DataDictionaryItem> list = GetDataDictionaryList(combo.Key1, combo.Key2); combo.ItemsSource = list; } Now, my problem is, when I change the SelectedValuePath in the XAML to Code3, it doesn't work. What I bind to SelectedValue still gets the full 4 character Code from DataDictionaryItem. I even tried rerunning SetItemsSource when the SelectedValuePath was changed and no dice. Can anyone see what I need to do to get my custom combobox to wake up and use the SelectedValuePath provided if it's overridden in the XAML? Tweaking the value in the property setter in my SelectedValue bound business object is not an option.

    Read the article

  • Adding ComboBoxItem to ComboBox Issue in Silverlight 4

    - by AlishahNovin
    I recently upgraded my Silverlight app from 3 to 4. After a few hours of bashing my head against the wall, trying to resolve an issue, I've narrowed down the problem to this: I have a user control, with a ComboBox inside it. The ComboBox has a single ComboBoxItem child. The user control exposes a get accessors that returns the ComboBox's Items object, allowing me to add additional ComboBoxItems via xaml. This all worked fine in Silverlight 3, however it's not working in Silverlight 4. As code: //XAML <UserControl ... > <ComboBox Name="myComboBox"> <ComboBoxItem Content="Select an Item" /> </ComboBox> <!-- All my other stuff --> </UserControl> //Code behind public ItemCollection ListItems { get { return myComboBox.Items; } } //Implementation of User-Control <CustomControl:UserControl ... > <CustomControl:UserControl.ListItems> <ComboBoxItem Content="Item 1" /> <ComboBoxItem Content="Item 2" /> <ComboBoxItem Content="Item 3" /> </CustomControl:UserControl.ListItems> </CustomControl:UserControl> As I mentioned, this all worked fine in Silverlight 3, but doesn't work in Silverlight 4. The workaround, it seems, is to remove that single ComboBoxItem that's inside my user-control, but I'm hoping to avoid, as I want it as the default item. Any help would be much appreciated!

    Read the article

  • ComboBox Binding inside Dataform Silverlight

    - by Sergio
    Hi, well I have my users table and my department table, so I have in XAML a Datagrid and a Dataform, in my dataform i have a combobox that is filled from the department table (all possible departments), I bind it to the Department attribute from my user, and it shows it. The problem is that when I click the edit button of the dataform the combobox goes blank... if i cancel the edit it goes back to the department of the user. Another thing is if i edit the user and choose a department when i commit the edit it works and when i edit that same user the combobox doesnt go blank now ... but for the other users it does if i havent specifically choosen the department in the combobox.

    Read the article

  • Silverlight 4, combobox databinding problem

    - by synergetic
    In my Silverlight 4 app, CustomerView (UserControl) shows Customer object as it's DataContext. Customer object has IndustryCode string property. I created combobox called cboIndustryCode and bind it to the IndustryCode property the following way: <ComboBox x:Name="cboIndustryCode" SelectedValue="{Binding IndustryCode, Mode=TwoWay}" ... /> In code-behind I populate cboIndustryCode with List of Industry object, which has Code and Name properties: cboIndustryCode.ItemsSource = industries; //which is of List<Industry> type Now, to show everything properly, in XAML I added the following: <ComboBox x:Name="cboIndustryCode" SelectedValue="{Binding IndustryCode, Mode=TwoWay}" DisplayMemberPath="Name" SelectedValuePath="Code" ... /> So, when I get a customer class from my data layer and set the DataContext to this customer instance, the cboIndustryCode properly displays industry name. But, then I edit customer (not necessarily IndustryCode) and save the object (which resets DataContext = new Customer()) and retrieve the customer again from database, and I see that cboIndustryCode no longer working. It just displays nothing, and if I select new value from the list, it does not update underlying customer object's IndustryCode property. The problem goes away, if I put the following code in the place where I set DataContext to a instance of customer, retrieved from database: Binding binding = new Binding("IndustryCode"); binding.Mode = BindingMode.TwoWay; cboIndustryCode.SetBinding(ComboBox.SelectedValueProperty, binding); So, in short, combobox's binding is reset somehow every time I save my data. Can someone tell me the reason?

    Read the article

  • WPF Combobox binding: can't change selection.

    - by SteveCav
    After wasting hours on this, following on the heels of my Last Problem, I'm starting to feel that Framework 4 is a master of subtle evil, or my PC is haunted. I have three comboboxes and a textbox on a WPF form, and I have an out-of-the-box Subsonic 3 ActiveRecord DAL. When I load this "edit record" form, the comboboxes fill correctly, they select the correct items, and the textbox has the correct text. I can change the TextBox text and save the record just fine, but the comboboxes CANNOT BE CHANGED. The lists drop down and highlight, but when you click on an item, the item selected stays the same. Here's my XAML: <StackPanel Orientation="Horizontal" Margin="10,10,0,0"> <TextBlock Width="80">Asset</TextBlock> <ComboBox Name="cboAsset" Width="180" DisplayMemberPath="AssetName" SelectedValuePath="AssetID" SelectedValue="{Binding AssetID}" ></ComboBox> </StackPanel> <StackPanel Orientation="Horizontal" Margin="10,10,0,0"> <TextBlock Width="80">Status</TextBlock> <ComboBox Name="cboStatus" Width="180" DisplayMemberPath="JobStatusDesc" SelectedValuePath="JobStatusID" SelectedValue="{Binding JobStatusID}" ></ComboBox> </StackPanel> <StackPanel Orientation="Horizontal" Margin="10,10,0,0"> <TextBlock Width="80">Category</TextBlock> <ComboBox Name="cboCategories" Width="180" DisplayMemberPath="CategoryName" SelectedValuePath="JobCategoryID" SelectedValue="{Binding JobCategoryID}" ></ComboBox> </StackPanel> <StackPanel Orientation="Horizontal" Margin="10,10,0,0"> <TextBlock Width="80">Reason</TextBlock> <TextBox Name="txtReason" Width="380" Text="{Binding Reason}"/> </StackPanel> Here are the relevant snips of my code (intJobID is passed in): SvcMgrDAL.Job oJob; IQueryable<SvcMgrDAL.JobCategory> oCategories = SvcMgrDAL.JobCategory.All().OrderBy(x => x.CategoryName); IQueryable<SvcMgrDAL.Asset> oAssets = SvcMgrDAL.Asset.All().OrderBy(x => x.AssetName); IQueryable<SvcMgrDAL.JobStatus> oStatus = SvcMgrDAL.JobStatus.All(); cboCategories.ItemsSource = oCategories; cboStatus.ItemsSource = oStatus; cboAsset.ItemsSource = oAssets; this.JobID = intJobID; oJob = SvcMgrDAL.Job.SingleOrDefault(x => x.JobID == intJobID); this.DataContext = oJob; Things I've tried: -Explicitly setting IsReadOnly="false" and IsSynchronizedWithCurrentItem="True" -Changing the combobox ItemSources from IQueryables to Lists. -Building my own Job object (plain vanilla entity class). -Every binding mode for the comboboxes. The Subsonic DAL doesn't implement INotifyPropertyChanged, but I don't see as it'd need to for simple binding like this. I just want to be able to pick something from the dropdown and save it. Comparing it with my last problem (link at the top of this message), I seem to have something really wierd with data sources going on. Maybe it's a Subsonic thing?

    Read the article

  • ComboBox doesn't fire SelectionChanged event

    - by Budda
    Subj. I am using Silverlight 4 with VS2010, here is a source code: <ComboBox Grid.Row="4" Grid.Column="1" Name="Player2All" MinWidth="50" ItemsSource="{Binding PlayersAll}" SelectionChanged="Player2All_SelectionChanged"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding ShortName}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> Here is code behind function: private void Player2All_SelectionChanged(object sender, SelectionChangedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); string strPlayerSelected = sender.ToString(); DebugTextBlock.Text = "hoho"; } This function is not called when I change selected item... Why? How can I get that workable? many thanks for any help.

    Read the article

  • jQuery UI combobox Ajax options

    - by Mithun
    Hi, I need to customize the combobox widget build from the jQuery UI Autocomplete http://jqueryui.com/demos/autocomplete/#combobox Currently drop down options are predefined from the SELECT tag OPTIONS or from a JSON array. //getter var source = $( ".selector" ).autocomplete( "option", "source" ); //setter $( ".selector" ).autocomplete( "option", "source", ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"] ); I want to populate the combobox options from a Ajax URL, how can i customize the widget?

    Read the article

  • Trigger for ComboBox in Silverlight

    - by Budda
    Is there any possibility to display selected item of the ComboBox (after popup closing) in a way that is different from its displaying in DropDown List (There are players number and name in the dropdown list, but after list closing I want to see only its number). How can I change a background for the player with some Flag? As far as I know, all of that can be done with triggers, but are they supported in Silverlight 4, VS2010, Silverlight Toolkit 4? In my case the following code <ComboBox ItemsSource="{Binding PlayersAll}" SelectedItem="{Binding Path=SelectedPlayer, Mode=TwoWay}" > <ComboBox.ItemTemplate> <DataTemplate> <ToolkitControls:WrapPanel Orientation="Horizontal"> <TextBlock Text="{Binding TeamNumber}"/> <TextBlock Text=" - "/> <TextBlock Text="{Binding ShortName}"/> </ToolkitControls:WrapPanel> <DataTemplate.Triggers> <Trigger Property="HasError" Value="True"> <Setter Property="Background" TargetName="FlagSet" Value="Red"/> </Trigger> </DataTemplate.Triggers> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> gives an error: The property 'Triggers' does not exist on the type 'DataTemplate' in the XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation' what is wrong here? Here are my namespaces: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" xmlns:ToolkitControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"

    Read the article

  • Adding a Combobox to a DataGrid in Silverlight

    - by bplus
    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> <TextBlock Text="{Binding SomeProp}" Margin="4"/> </DataTemplate> </local:DataGridTemplateColumn.CellTemplate> <local:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <ComboBox x:Name="SomeCombo" SelectionChanged="SomeCombo_SelectionChanged" ItemsSource="{Binding SomeList}" DisplayMemberPath="Name" /> </DataTemplate> </local:DataGridTemplateColumn.CellEditingTemplate> </local:DataGridTemplateColumn> However what I can't figure out is a sensible way to get the row that was combox is bound to. i.e. when handling the combobox SelectionChanged event I have no way of knowing what what row the combobox belongs to. Particularly I don't know what object in the DataGrid datasource that the combobox is refering to. Any help would be much appreciated.

    Read the article

  • Showing a tooltip on a combobox from the itemtemplate (WPF)

    - by Jamie
    I have a ComboBox with a DataTemplate. The DataTemplate has two controls, each of which has a ToolTip attached to it. The list of items of the ComboBox has the tooltips as expected when you hover over each control. But the selected item area on top of the ComboBox does not display the tooltips, though the controls are rendered as expected. Is there a way to force the tooltips to be displayed?

    Read the article

  • ComboBox's Selected Value Changed On Lost Focus in VB.NET

    - by tunwn
    I have a datagridview(dgv) with a DataGridViewComboBoxColumn(colLocation) colLocation.AutoComplete = False colLocation.HeaderText = "Stored to" colLocation.DataSource = DB.getLocation() colLocation.DisplayMember = "description" colLocation.ValueMember = "id" I added the colLocation to dgv. "descirption" contains Unicode characters. I can see the comboBox correctly and choose the item. The problem is when the comboBox lost the focus, the value is changed to first item of the comboBox. Any suggestion? Updated: I found out that the ComboBox doesn't change the data when the DisplayMember is in English characters. It changes only when the DisplayMember is in Unicode chracter. Any idea for how could solve this? – tunwn 0 secs ago

    Read the article

  • WPF ComboBox in Grid Issue

    - by Nathan
    I am trying to put a series of comboboxes in a grid and then I bind them to a list. For some reason unknown to me when I click the open button on the combobox nothing happens. If I move a comobobox outside the grid it opens just fine. Can someone please tell me what I am doing wrong here. It has to be something stupid because I've used comoboxes before just fine. Here is my xaml: <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <GroupBox Header="Download Critera" Margin="70,30" Name="groupBox1" Grid.RowSpan="2"> <Grid Height="Auto" Name="grid1" Width="Auto" Margin="0" IsHitTestVisible="False"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock Grid.Row="1" Margin="10,5,5,5" Name="textBlock1" Text="A:" Foreground="Black" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" /> <TextBlock Grid.Row="2" Margin="10,5,5,5" Name="textBlock2" Text="B:" Foreground="Black" VerticalAlignment="Center" FontWeight="Bold" /> <TextBlock Grid.Row="3" Margin="10,5,5,5" Name="textBlock3" Text="C:" Foreground="Black" VerticalAlignment="Center" FontWeight="Bold" /> <TextBlock Grid.Row="4" Margin="10,5,5,5" Name="textBlock4" Foreground="Black" Text="D:" VerticalAlignment="Center" FontWeight="Bold" /> <TextBlock Grid.Row="5" Margin="10,5,5,5" Name="textBlock5" Text="E:" Foreground="Black" TextAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" /> <ComboBox x:Name="cb1" Grid.Column="1" Grid.Row="1" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb2" Grid.Column="1" Grid.Row="2" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb3" Grid.Column="1" Grid.Row="3" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb4" Grid.Column="1" Grid.Row="4" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> <ComboBox x:Name="cb5" Grid.Column="1" Grid.Row="5" Margin="5" MaxDropDownHeight="100" ItemsSource="{Binding Projects}"/> </Grid> </GroupBox> </Grid>

    Read the article

  • SelectedIndex of combobox not updating correctly using databinding.

    - by Matthijs Wessels
    I have a ComboBox: <ComboBox Name="iComponentFieldComboBox" SelectedIndex="{Binding ComponentFieldSelectedIndex, Mode=TwoWay}" Height="23" Margin="132,0,280,38" VerticalAlignment="Bottom"> <ComboBoxItem Name="item1">item1</ComboBoxItem> <ComboBoxItem Name="item2">item2</ComboBoxItem> <ComboBoxItem Name="item3">item3</ComboBoxItem> </ComboBox> When I start my WPF and set the ComponentFieldSelectedIndex property of my ViewModel in my code, nothing happens. But after I have selected an item in the combobox, then suddenly setting ComponentFieldSelectedIndex does work. for example: start app. click button that sets ComponentFieldSelectedIndex to 1. selected item doesn't change to item2. select item3 in combo box. click button that sets ComponentFieldSelectedIndex to 1. selected item does change to item2. Does anyone have an idea what could be causing this?

    Read the article

  • activate and deactivate ComboBox

    - by Jessy
    How can I make the comboBox available when the checkBox was uncheck (vice versa) Why the comboBox is still disable after I unChecked the checkBox? choice [] = {"A","B","C"}; JComboBox a = new JComboBox(choice); JCheckBox chk = new JCheckBox("choice"); ... a.addActionListener(this); chk.addActionListener(this); ... public void actionPerformed(ActionEvent e) { //disable the a comboBox when the checkBox chk was checked if(e.getSource()==chk) a.setEnabled(false); //enable the a comboBox when the checkBox chk was unchecked else if(e.getSource()!=chk) a.setEnabled(true); }

    Read the article

  • How to retrieve combobox selection in a windows form

    - by Edward Leno
    All, I have a simple windows form with a combobox and a 'OK' button. After clicking the 'OK' button, I want to retrieve the selected combobox value. The GetUserForm has 2 controls: combobox named cmbUser, with a list of 2 values button named btnOK Nothing has been done to the GetUserForm class itself. The class contains: public partial class GetUserForm : Form { public STAMP_GetUser() { InitializeComponent(); } } GetUserForm f = new GetUserForm(); f.ShowDialog(); // not sure how to access the combobox selected value? Do I need to initialize something in the class? Or can I access the controls on the form using the 'f' variable above?

    Read the article

  • Binding Combobox SelectedItem by a field's value

    - by Navid Farhadi
    Combobox bind to a set of Provinces, Village object has ProvinceID field and i want to bind SelectedItem of Combobox to a Province with Village's ProvinceID. My code is: <ComboBox ItemsSource="{Binding ProvincesList}" DisplayMemberPath="ProvinceName" SelectedValuePath="ProvinceID" SelectedValue="{Binding Village.ProvinceID}" /> But SelectedItem is anything.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >