We use MVVM. The following code is working fine when using the RadControl Q1 2010.
<TabControl ItemsSource="{Binding StandardTimeSlotTabs}" SelectedIndex="{Binding StandardSelectedTabIndex, Mode=TwoWay}" >
<TabControl.ContentTemplate>
<DataTemplate>
<controls:RadGridView ShowColumnFooters="True" ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" IsReadOnly="True" AutoGenerateColumns="False" GridLinesVisibility="None" ItemsSource="{Binding StandardTimeSlotItems}"
CurrentItem="{Binding DataContext.SelectedStandardTimeSlotItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type vw:OrderEntrySchedulingStandardFieldView}}}"
SelectedItem="{Binding DataContext.SelectedStandardTimeSlotItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type vw:OrderEntrySchedulingStandardFieldView}}}"
>
<controls:RadGridView.Columns> blah </controls:RadGridView.Columns>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
The SelectedItem is bound to a RelativeSource, the Setter and Getter for DataContext.SelectedStandardTimeSlotItem are working fine when row selection changes.
After we updated to Q2 2010, the row selection changes will not fire the Setter of DataContext.SelectedStandardTimeSlotItem, but the getter was callled when the control is loaded. if I put a stop point in the SelectChanged event, the Selecteditem is changed when the row selection is changing. It seems the RelativeSource works for the getter, but not when the selection is changed. Is it a bug or I missed something? Keep in mind it worked fine in Q1, nothing else is changed.
Thanks!
Amy
<TabControl ItemsSource="{Binding StandardTimeSlotTabs}" SelectedIndex="{Binding StandardSelectedTabIndex, Mode=TwoWay}" >
<TabControl.ContentTemplate>
<DataTemplate>
<controls:RadGridView ShowColumnFooters="True" ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" IsReadOnly="True" AutoGenerateColumns="False" GridLinesVisibility="None" ItemsSource="{Binding StandardTimeSlotItems}"
CurrentItem="{Binding DataContext.SelectedStandardTimeSlotItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type vw:OrderEntrySchedulingStandardFieldView}}}"
SelectedItem="{Binding DataContext.SelectedStandardTimeSlotItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type vw:OrderEntrySchedulingStandardFieldView}}}"
>
<controls:RadGridView.Columns> blah </controls:RadGridView.Columns>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
The SelectedItem is bound to a RelativeSource, the Setter and Getter for DataContext.SelectedStandardTimeSlotItem are working fine when row selection changes.
After we updated to Q2 2010, the row selection changes will not fire the Setter of DataContext.SelectedStandardTimeSlotItem, but the getter was callled when the control is loaded. if I put a stop point in the SelectChanged event, the Selecteditem is changed when the row selection is changing. It seems the RelativeSource works for the getter, but not when the selection is changed. Is it a bug or I missed something? Keep in mind it worked fine in Q1, nothing else is changed.
Thanks!
Amy