Selected ListView The item binding does not work

I have a listview in uwp , and a view model that declare pataient_List and selected_patient in this. my listview show itemsource but I don't know why my listview do not show selected item. <ListView ItemsSource="{Binding pataient_List}" Selec

Can not access the item element in my list view

I have a ListView where I have some of subjects. When I press on the item(Subject), I can't access into My AssignaturaActivity view. I'm using a setOnItemClickListener in order to throw the activity, but it doesn't respond. I did my own adapter,and m

ListView access to the selected item in viewmodel

I'm following MVVM pattern. I have a listview control which has multiple checkboxes. my viewmodel has collection of Student which is bounded to listview control. public ObservableCollection<Student> students{ get; private set; } private ObservableCo

Set the selected item in the drop-down list in MVC3

I have to set the selected item for a dropdownlist in view. But its not working. //View <div class="editor-label"> @Html.LabelFor(model => model.Gender) </div> <div class="editor-field"> @Html.DropDownListFor(model

How to select ListView items programmatically?

I've been looking for a solution since this morning, and even after reading tons of other threads on this subject it doesn't work for me. Without further ados let's check this code sample: // Create Dictionary, Keys = Ids, Values = Names Dictionary<i

Display the value of the selected element - no Index

I am working on a project (simple phone book) for personal use. This is how it looks like: I have a listview filled with contacts and everything was working perfectly untill I added this line of code, when everything became messed up. listView1.Sorti

WPF Combobox SelectedIndex does not work

I have a WPF user control (FileSelectionView.xaml) with a combo box that displays data. My WPF looks like: <ComboBox Width="250" HorizontalAlignment="Left" ItemsSource="{Binding Path=FileTypes}" SelectedItem="{Binding

WPF / MVVM saves the selected item in viewmodel / model

How must I declare the SelectedItem property in my Viewmodel/Model to save the SelectedItem from a Datagrid to it , so that the Datagrid's property SelectedItem has a Binding to the SelectedItem property in my Viewmodel/Model. What kind of datatype I

wp7: highlight the selected image in a list box

I have a list box where I'm displaying a list of icons. I want to highlight the selected item by changing the icon color from 'white' to 'blue'. This sounds simple to me, but it seems to be very difficult. Does anyone have suggestions on the best app

WP7 Listbox - erase the selected item

I am using a listbox in a data template - and from an earlier post I cannot reference the listbox directly in the code behind. As a result I am capturing the last selected object in the selectionchanged event for the listbox and using this when I wan

wpf combobox with checkbox - selecteditem

I have a simple ComboBox with CheckBoxes as Items. How can I prevent the actual selection of the items. The user should only be able to check or uncheck the checkboxes? Currently if I click on an element (not on the content or the check itself) it be

ComboBox1.SelectedItem.ToString () does not work

String cmbvalue = comboBox1.SelectedItem.ToString(); if (cmbvalue == "Income") { curvalu = int.Parse(txtbalance.Text); finalvalu = curvalu + int.Parse(txtIncomeExpense.Text); MessageBox.Show(comboBox1.SelectedItem.ToString()); SqlCommand sqlcomm

How to get the last value selected in a list of checkboxes?

I am currently facing a problem. How to get the latest selected value from a checkbox list? From looping through the Items of a checkbox list, I can get the highest selected index and its value, but it is not expected that the user will selec

How to make sure no items are selected in the ListBox database?

OK, this must be a duplicate question, but I cannot find the answer: I have a listbox that is databound to a Collection. By default Items[0] is selected. How can I prevent this in order to ensure that the SelectionChanged event is raised any time I c

Display content only when ListViewItem is selected

I have a ListBox when one of the ListBoxItems are selected I want to change the visibility of the button "View" and display it. Meaning that the default state is Hidden. Is this possible and if so, do I solve this with a trigger in XAML or in co

WPF Listview access to SelectedItem and sub-elements

Ok, I am having more problems with my C# WPF ListView control. Here it is in all its glory: <Window x:Class="ebook.SearchResults" xmlns="" xmlns:x="http://schemas.microso

Get SelectedItem from TreeView?

Does anyone know how I can get the SelectedItem (not the Header) from a TreeView? Here is my code: <TreeView Name="treeView1" DataContext="{Binding Path=PresentationsViewModel}" Grid.Column="1" > <TreeViewItem IsExpa

Link to a sum of SelectedItems in WPF GridView

I have a GridView that contains a list of files, created dates, and file sizes. Below the grid I have a textblock that says "X Files Selected. Y MB". I can bind to SelectedItems.Count just fine, but can I easily bind to the sum of the file sizes

How can I hide the selected item in a WPF combo box?

I want to hide the selected item from the opened WPF combo box, basically to show instead of this: item2 item1 item2 item3 this: item2 item1 item3 How can this be done?Why don't you change the selected item's visibility instead?