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
13
votes
1 answer

WPF TabControl Change selected tab

Hi I have two questions. How do I programatically change the selected tab in a WPF Tab control from one tab to another. How would I get a reference to this "other tab" in which I want to set the selected tab?
Clint
12
votes
3 answers

How to get the latest selected value from a checkbox list?

I am currently facing a problem. How to get the latest selected value from a asp.net 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…
Masud Rahman
  • 1,064
  • 4
  • 14
  • 28
12
votes
3 answers

How to set an 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?
msfanboy
  • 5,273
  • 13
  • 69
  • 120
12
votes
1 answer

IsSynchronizedWithCurrentItem attribute and current item updates

I have a view model to manage a dialog type of view that allows filtering of a listing (if necessary) and selection of an item. The code works fine whether I set IsSynchronizedWithCurrentItem to true or not. My understanding is that this property is…
Berryl
  • 12,471
  • 22
  • 98
  • 182
12
votes
5 answers

(CSS?) Eliminating browser's 'selected' lines around a hyperlinked image?

The attached screenshot is from OS X/Firefox 3. Note that the center tab (an image) has a dotted line around it, apparently because it was the most-recently selected tab. Is there a way I can eliminate this dotted line in CSS or JavaScript?…
Doug Kaye
  • 1,565
  • 5
  • 23
  • 32
12
votes
9 answers

ListBox always auto selects first item

ListBox's behavior is that the first item is selected automatically, how can I avoid that?? Note: I prefer to do this with pure xaml, if you have any code-behind ideas then please don't bother yourself.
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
12
votes
5 answers

Should I use a Winforms combobox's SelectedItem, SelectedText, or SelectedValue?

I want to pass a value in a combo box as a param to a SQL statement. The Winforms combobox gives me several options for retrieving the value, namely SelectedItem, SelectedText, and SelectedValue. Which one is best/safest to use in this scenario?
11
votes
1 answer

ListBox Style Selected item on windows phone

i would like know how can i add a style when a item of the listbox is selected. I have the following listbox:
Filipe Batista
  • 1,862
  • 2
  • 24
  • 39
11
votes
4 answers

How to: Remove an item from a List

How to: Remove an item from a List I have got the following code snippet... companies.Remove(listView_Test.SelectedItem.ToString()); There is a listView that contains (let's say) 3 items without a name, just with a Content of "A", "B" and "C". Now…
sjantke
  • 605
  • 4
  • 9
  • 35
11
votes
4 answers

WPF ComboBox resets selected item when item-source changes

Consider the following XAML:
Miroslav Bajtoš
  • 10,667
  • 1
  • 41
  • 99
11
votes
1 answer

set selected item in combobox - vb.net

I am using this code to add a value to a combobox different then the one displayed: how to add value to combobox item Lets suppose i have 3 values in my Combobox: item 1 item 2 item 3 If i chose item 2 from the dropdown the code in the link…
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97
10
votes
4 answers

Combobox SelectedItem doesn't update when source changes

I have a viewmodel which implement INotifyPropertyChanged. On this viewModel is a property called SubGroupingView. This property is bound to the selected item of a combo box. When i change the combo box, the source property is being updated fine,…
TerrorAustralis
  • 2,833
  • 6
  • 32
  • 46
10
votes
2 answers

SelectedIndex with OneWayToSource binding does not trigger

I have a problem with a particular xaml databinding. I have two listboxes (master-details, so the listboxes have IsSynchronizedWithCurrentItem set to true). I want my viewmodel to know when the selected item on the details listbox changes: I…
Gufino2
  • 228
  • 2
  • 9
10
votes
2 answers

How to databind SelectedItem of RibbonComboBox

My question is basically this one. I thought it would help to provide some more information and code that makes it easier to reproduce the problem, though. Working with the Microsoft.Windows.Controls.Ribbon.RibbonComboBox from the…
Mike Fuchs
  • 12,081
  • 6
  • 58
  • 71
10
votes
2 answers

How to change selected tab on Button click in WPF TabControl with Buttons in Header

I have a WPF TabControl that has a couple of buttons in the TabItem header. I want the selected tab to change when a headered button is clicked. Here is a code snippet:
HiteshP
  • 757
  • 2
  • 8
  • 15
1 2
3
67 68