This is a migrated thread and some comments may be shown as answers.

RelativeSource Bugs in Q2 2010?

6 Answers 44 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 20 Jul 2010, 08:17 PM
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

6 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 21 Jul 2010, 05:50 AM
Hi Amy,

Could you please try to use TwoWay binding mode for the SelectedItem binding.


Sincerely yours,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Amy
Top achievements
Rank 1
answered on 21 Jul 2010, 02:41 PM
Acutally, I did try to use TwoWay in both SelectedItem And CurrentItem, but it didn't work.   I did more testing also, if the RadGridView is not inside the DataTemplate, then the setter will be called.  Any  other suggestions?

Thanks!

Amy
0
Milan
Telerik team
answered on 22 Jul 2010, 11:17 AM
Hi Amy,

Will it be possible to send us your project so that we can debug it on our site? This would really help us resolve the problem in a more timely fashion. 


Greetings,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
May
Top achievements
Rank 1
answered on 23 Jul 2010, 04:13 PM

Hi Milan,

I can't send your my project files since it is too big and needs DB connection.  However i made a test project to demo the problem. The demo project has 2 RadGridView, one is inside DateTemplate, one is not. The VM.cs is DataContext for the window, if you add a stop point at line 46 and line 79 which are bound to SelectedItem for the RadGridView.  The attched project used Q1 DLLs, when you change the row selection, the Selecteditem setter will be called for top/bottom RadGridView.   But when you switch the DLLs to the Q2 ones, the Selecteditem setter for the top RadGridView is stopped working, but the bottom one is OK.

 

If you need more information, please let me know.

 

Thanks!

 

Amy


BTW, i can't attach the demo project file since the size issue. I submit my bug report with soluction file under my other account. The
ticket id is: 331441. Would please take a look? Thanks!

0
Milan
Telerik team
answered on 29 Jul 2010, 08:22 AM

Hello May,

We are currently working on a solution to this problem and I will notify you as soon as this issue is resolved. Thank you for your patience.



Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Milan
Telerik team
answered on 02 Aug 2010, 03:21 PM
Hello May,

We have resolved the issue and the fix will be included in this weeks Internal Build. Thank you for your patience.


Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Amy
Top achievements
Rank 1
Answers by
Milan
Telerik team
Amy
Top achievements
Rank 1
May
Top achievements
Rank 1
Share this question
or