Questions tagged [selecteditem]

selecteditem is a property used to identify the currently selected item in a collection

selecteditem is used to check the state of the associated UI control in several APIs

References

1008 questions
10
votes
2 answers

What is the easiest way to handle SelectedItem event with MVVM?

In the code below, when user selects Customer in the combobox, the customer's name is displayed in a textbox. I fill the Combox box with an ObservableCollection property on my ViewModel but how do I handle the SelectedItem event in my…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
9
votes
9 answers

How to check whether the item in the combo box is selected or not in C#?

I have a combo box in which I have to display the dates from a database. The user has to select a date from the combo box to proceed further, but I don't know how to make the user aware of selecting the item from the combo box first in order to…
zoya
  • 473
  • 4
  • 11
  • 21
9
votes
3 answers

WPF isn't binding ComboBox SelectedItem

I already search widely, but I can't find any solution to my case. I have several ComboBox's at my project and I was searching for an AutoComplete solution, then I found a good one and applied in my project, I applied solution's style as well to all…
9
votes
2 answers

TreeView Sync to SelectedItem in View Model

I have a ViewModel on top of a WPF TreeView control. I want the ViewModel to be able to set and read the SelectedItem from the TreeView. However, the SelectedItem property of the TreeView is not bindable. I am able to set and get the selected item…
according2me
  • 479
  • 6
  • 16
9
votes
2 answers

How can I get the clicked item in the ajax method?

Suppose the code of this page:
yersan
  • 332
  • 1
  • 2
  • 13
8
votes
2 answers

ASP.Net RadioButtonList: using jQuery to get the ListItem selected

have 2 RadioButtonLists: Are you a minor?: oYes oNo Do you wish a joint account?: oYes oNo If the answer to the 1st question is yes, I want to detect the response to the first question and set the answer to the 2nd question to yes using a…
Susan
  • 1,822
  • 8
  • 47
  • 69
8
votes
2 answers
8
votes
4 answers

Binding ComboBox.SelectedItem in Silverlight (more)

Related to my previous question: Binding ComboBox.SelectedItem in Silverlight I have a ComboBox bound like so:
Josh Santangelo
  • 936
  • 4
  • 11
  • 16
8
votes
1 answer

Winforms ComboBox SelectedItem changing does not affect the BindingSource

I am making C# / WinForms application. The problem I couldn't solve (yet) is that when I change the SelectedItem of ComboBox programatically, it is changed until the ComboBox loses the focus, after that it "reminds" its value before assigning the…
Revaz
  • 310
  • 1
  • 2
  • 11
8
votes
2 answers

WPF - Bind to selecteditem of listbox between user controls

I have two usercontrols, the first with a listbox that is bound to a list of Customers that displays some simple details for each customer. The second user control I would like to be a more detailed view of whichever customer is selected in the…
gr-eg
  • 306
  • 2
  • 4
  • 13
8
votes
2 answers

WPF Xaml Custom Styling Selected Item Style in a ListBox

I have a ListBox that scrolls images horizontally. I have the following XAML I used blend to create it. It originally had a x:Key on the Style TaregetType line, MSDN said to remove it, as I was getting errors on that. Now I'm getting this…
John Batdorf
  • 2,502
  • 8
  • 35
  • 43
8
votes
3 answers

check if a values has been selected from dropdown in c#

I have 3 dropdown boxes (combo box) in asp.net environment. They are all optional, so if a user has selected anything, i am updating database, if nothing has been selected at all, i am still updating database with null values. I tried to do this: …
iamserious
  • 5,385
  • 12
  • 41
  • 60
8
votes
2 answers

AngularJS - setting selected value of dropdown does not work

I made a fiddle replicating my problem here: http://jsfiddle.net/U3pVM/2840/ As the title suggests, I can't set the selected value of a select populated using ng-options. I have searched and tried all possible solutions that I found. Any help or…
OverMars
  • 1,077
  • 3
  • 16
  • 33
8
votes
1 answer

Can't clear ListBox selection using SelectedItem = null - MVVM

I have the following data template (and a corresponding view model, not shown): ItemsSource is bound to a list of…
NielW
  • 3,626
  • 1
  • 30
  • 38
8
votes
1 answer

Type list of selected items in a wpf datagrid

I send the selected items to a specific command when the selection changes (each item is a class X) I get them as object how can I convert it to a list? I tried: 1. IList SelectedItemsList = obj as ObservableCollection; 2. IList
Hodaya Shalom
  • 4,327
  • 12
  • 57
  • 111