selecteditem

WPF - Setting ComboBox.SelectedItem in XAML based on matching object

Hi, so, I have templated combobox that is basically acting as a simple colour palette. It is populated with a list of SolidColorBrush objects. Fine. Now, I have some data that holds the hex value of the current colour. I have a converter that converts the hex into a SolidColorBrush. Also fine. Now, I want to set the SelectedItem prop...

Wpf SelectedItem wont work for a Combobox in a ListView

Hi there, I´ve got a problem with a Combobox in a ListView. I´ve got a class called "Substrate". This class contains an object of a class called "SubstrateType". I want to show the objects of the class "Substrate" in a Listview. Each property of the "Substrate" is presented in the columns of the Listview. For the different "SubstrateTyp...

silverlight 3 listbox item highlight versus selected.

I have a listbox and am attempting to select and item in code. Sometime one item is highlighted, that is it is background is colored blue, but a different item has a square blue box around the it (no highlighting just an hollow outline of a box). Am I correct in saying one is "highlighted" and one is "selected" and do I have them corre...

ASP.NET lisbox - Selected first item, always

I have a list box which is populated using a dictioanry. When I iterate throught the selected items using the following code, it always show only the first items as selected - even if the first item is not selected. Have you ever encountered this scenario? Could you please help on this? This problem occurs when I use dictionary for bi...

Binding a listbox SelectedItem to an Observable Collection?

I have a Listbox in WPF with the SelectionMode set to Multiple, and can multiselect the items in the Listbox. However, the SelectedItem is not updating the Observable Collection it is bound to. Is there a way to bind the multiple selected items from a ListBox to an Observable Collection? ...

Silverlight nested RadGridView SelectedItem DataContext

Hi, I'm developing a Silverlight 4 app and am using the 2010 Q1 release 1 RadGridView. I'm developing this app using the MVVM pattern and trying to keep my codebehind to a minimum. On my View I have a RadGridView and this binds to a property on my ViewModel. I am setting a property via the SelectedItem. I have a nested RadGridView a...

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 ? ...

WPF SelectedItem not working in MVVM

Hi, I'm trying to display the data from two sql ce 3.5 sp1 database tables linked with foreign key - Customers and Orders. When the customer is selected in a datadrig, I want the other grid to be populated with the Orders. I'm using a query: var profiles = from c in db.Customers.Include("Orders") select c; A...

How to transform a String into an object name selectedItem in the DataGrid? flex3

Hello Friends, I need to get the value of the item clicked and the name of the columns. for each(item in colunas) { var itemok:String = item.dataField; Alert.show(''+datagridlist.selectedItem.itemok); // show value of column } But this way it returns 'undefined'. But if I put the name already in function, I...

How do I bind selectedItem property of WPFToolkit-Datagrid to my viewmodel property ?

Hi, I have a WPFToolkit-datagrid and a View-model class with a property - "SelectedGridItems" How do I bind selectedItem property of WPFToolkit-Datagrid to my viewmodel property ("SelectedGridItems") ? ...

Can I use Property Trigger to get selected items from WPFToolkit datagrid ?

Hi, I have a wpfToolkit-datagrid. Can I use a trigger for the following "IsSelected" property to update a selectedItems list in view-model ? < Style TargetType="tk:DataGridRow"> < Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> < /Style> ...

WPF, TreeView bug, can't select root item after item removed from treeview

I have a very weird bug in a three level deep TreeView. It is intermittent and I can't find how to reproduce it consistently. After programmatically removing, adding then removing some third level items, when I click on the root item it isn't selected. It can still expand/collapse but can't be selected with a mouse click and it doesn't f...

CF - MenuItem selection in MainMenu

Hello. Again i wonder how can i highlight selected item in my MainMenu form. Every time i select an item only the first item is highlighted (always the same). But when a MenuItem is clicked its highlighted untill the Menu reloads. I found "checked" property on MenuItem that would generaly work, but the first item remains highlighted. T...

WPF: ComboBox with selecteditem set make not use of SelectedIndex=0 ?

Hello, Why is the first element in my combobox popup menu not shown in the selected item area of my combobox , when I use the SelectedItem binding? Without that it is showing up ?? Using the same code selecteditem + selectedindex that is no problem! <ComboBox ItemsSource="{Binding SchoolclassSubjectViewModels}" Selec...

How do I get the value of the item selected in ListView?

I thought I could use the position int, but when I click on the item in the list view, nothing happens. Please help! ListView d = (ListView) findViewById(R.id.apo); ArrayAdapter adapt = ArrayAdapter.createFromResource(this, R.array.algebra, android.R.layout.simple_list_item_1); d.setAdapter(adapt); d.setOnItemClickListener(new OnIt...

Can i make TreeView remember its structure when raising OnPropertyChanged?

Is it possible to not reset the nodes which are open and closed when the OnPropertyChanged-event is fired and the TreeView updates is ItemsSource? If i add an object now, all nodes collapses! ...

android gallery item selector

I want to use following selector drawable for android gallery image will it work ? <selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; <item state_selected="true" android:drawable="@drawable/selected_icon" > </item> <item android:drawable="@drawable/unselected_icon" > </item> </selector> ...

SubSonic 3 screws up selecteditem?

If you have a moment, please try this: -Download Subsonic 3. -Start a new proj and add SS's ActiveRecord templates. -Point it to any SQL Server DB and generate the classes. -Add a WPF project. -Create a window and add a combobox or listbox. -Set the ItemsSource from the SS DAL, and format it how you wish. -Add a button that will show ...

WPF: DataGridComboBoxColumn loses its content when selection changes

Hello, When I click a cell in my DataGridComboBoxColumn the ComboBox gets visible and I can select items. When I have selected an item its visible at the top thats fine. But when the cell aka ComboBox loses its focus because I click something different in the DataGrid then there is no item/text visible anymore in the cell I have previou...

WPF/MVVM: Know the SelectedCell of a DataGrid`s SelectedItem and assign a value to the SelectedCell

I bet this stuff can`t be done without much code-behind :P Can it? ...