selectionchanged

Do WPF ComboBox SelectedIndex and SelectedValue have different behavior on SelectionChanged event?

Hello guys I got this cbxJobPosition_SelectionChanged firing as expected. The problem is when a external method tries to set cbxJobPosition. cbxJobPosition is databinded with a list of objects of type JobPosition: JobPositionID: 1, JobPositionName: Manager JobPositionID: 2, JobPositionName: Employee JobPositionID: 3, JobPositionName:...

XAML ComboBox SelectionChanged Fires OnLoad

If I have a ComboBox that has a SelectionChanged event, it fires when I'm loading the control. So at page load I set the SelectedValue and the SelectionChanged event fires which is not what I want to happen. What is the accepted apporach to stopping this? ...

Silverlight 3 DataGrid SelectionChanged event fired when switching applications

This is annoying...When running my SL3 app with a datagrid after having selected a row in the grid, if I alt-tab to a different application and then alt-tab back - the SelectionChanged event fires! No click or touch was done to the SL app. What I'm trying to do is allow the user to click on a row to mark it Read/Unread but I guess I'm g...

WPF ListView SelectionChanged inside style does not work. EventSetter either.

<Style x:Key="OrderGroupTemplateStyle" TargetType="{x:Type ContentControl}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Name.ShowDetailedInfo, UpdateSourceTrigger=PropertyChanged}" Value="False"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <Border BorderBrush="G...

How to fire new SelectionChanged Event

Hi. I'd like to fire a SelectionChangedEvent. What I have is this: Fluent.ComboBox fcb = elt as Fluent.ComboBox; fcb.RaiseEvent( new SelectionChangedEventArgs( null, new List<double>() { (double)fcb.SelectedItem }, new List<double>() { fontSize }) ); My question is what I have to insert for the null parameter. The constructor expe...

WPF C# - ComboBox methods return object instead of string

I'm new to WPF and I'm trying to figure out how to get the current text value of the selected item in a ComboBox. I saw in this question someone suggested doing MyComboBox.SelectedItem.Text. However, SelectedItem returns object for me, so I only have options like ToString(), Equals, etc. What's going on? I'm using .NET 3.5, developin...

listview doesn't get updated after changing isSelected property

I use an ObservableCollection<customclass> with an isSelected property bound to a listview. The customclass items are added via asyncrhonous communication with a server. I register to an NotifyCollectionChanged event and there under certain conditions set the isSelected property to true. However, this doesn't update my view. Only after s...

RichTextBox Save "Selection Direction"

Hi. I have a WinForms program where, whenever you change your selection, the RichTextBox needs to change the colour of certain other text. In order to do this, it has to select that text, and therefore I lose my current selection. I can save and load the SelectionStart and SelectionLength properties, but I can't keep the "selection dire...

MVVM-Light What about events?

I started using MVVM-Light with WPF yesterday and it really makes a difference when it comes to structuring the code. But now i'm trying to figure out how to handle event. Lets say I've got this view, with a TabControl. In every TabItem i have a ListBox. Now how do i handle the event SelectionChanged? And to mess things up, can i send ...

Wpf - NavigationService.GoBack() and Listbox SelectionChanged Event

Hi All, In ADDPage.xaml page there i s a Back Button with the code NavigationService.GoBack() to go back to the previous page. Problem: In the Listbox SelectionChanged Event of another page (SubPage.xaml)i am using the NavigationService.Navigate(new ADDPage(search)); When ever the page executes NavigationService.GoBack() of ADDPage...

WPF TabControl On SelectionChanged, set focus to a text field

I have a tab control, and a few tab items. I am successfully listening to the SelectionChanged event, and checking if the tab I'm interested in is the currently selected one. I'm using this code (below), and stepping through the debugger, I can see that my branching logic works as designed; however, the issue I'm having is that somethin...

How to get OnSelectionChanged ListBoxItem background change when modifying the data at the same time using a ListBox control ?

Hi, I have a ListBox control with an ObservableCollection instance as the control's ItemsSource property. Everything works fine, but when I handle the control's OnSelectionChanged, my business logic modifies the collection's data and I no longer get the ListBoxItem background change you usually get when your ListBox selection changes....

WPF - Animation on SelectionChanged

How would I go about changing a TabItem color from it's unselected color to it's selected color with an animation on SelectionChanged, so that both the unselected and selected TabItems change? Edit: This is how my CustomTemplate looks like. There is no animation happening at all so what have I done wrong? <Style TargetType="TabItem"> ...