Weird issue with Telerik Details Row Template

Feb 7, 2011 at 5:21 PM
Edited Feb 7, 2011 at 5:36 PM

I'm using a DataTemplate for a Telerik Grid Row Details:


<DataTemplate x:Key="RowDetailsRole">
		<Telerik:ParentRadGridViewDataContextSpy x:Name="ParentRadGridViewDataContextSpy"  />

			cal:View.Model="{Binding Path=DataContext.ScreenDefinitionPermissionsEditViewModel, ElementName=ParentRadGridViewDataContextSpy}"


	RowDetailsTemplate="{StaticResource RowDetailsRole}"

The works fine for any new (not previously clicked on) row I click on (clicking on a row shows the row details template), but when I navigate to another new row then back to a previous row that loaded fine, the content of the previous row details contentcontrol is null.

I've also tried:

                                        cal:Bind.Model="{Binding Path=DataContext.ScreenDefinitionPermissionsEditViewModel, ElementName=ParentRadGridViewDataContextSpy}" />
But that has problems of it's own. I get output window binding errors messages indicating it's trying to bind to the row details datacontext instead of the Model specified. If I resize the browser window so it obstructs and shows the view it refreshes properly, obviously that's not a viable work around. 

Feb 7, 2011 at 7:36 PM

Have you tried making the binding TwoWay?

Feb 7, 2011 at 8:08 PM

I had a co-worker test with TwoWay just now on that revision of the code, no effect. In the mean time I've refactored the curretn code so that a new view/viewmodel is created for each row in the datagrid. Before it was using the same view/viewmodel instance, which was more performant but exhibited those bugs.