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

Disable Child GridView refesh on main GridView refresh

1 Answer 72 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 29 Aug 2014, 03:51 PM
I have a GridView whose ItemsSource is bound to an ICollectionView. This GridView has a child GridView whose ItemsSource is bound to a property of currently selected item of the main GridView.

This all works fine, however, when ever ICollectionView of the main GridView is refreshed the child GridView is also refreshed so it loses it current scroll position and item selection.

Any ideas on how to prevent the child GridView from refreshing when main GridView ItemsSource is refreshed?

1 Answer, 1 is accepted

Sort by
0
Boris
Telerik team
answered on 02 Sep 2014, 11:36 AM
Hello Dean,

The described behavior is expected. When the ICollectionView is refreshed, the whole view is recreated. The GridView does not save any settings for the RowDetails, because there is no way to know with what they are filled with. 

A possible way to keep the scroll position and the item selection, is to update only the individual item, and not refresh the whole ICollectionView.

I attached an example of what I have in mind. In the sample project expand the first item and select one of its RowDetail items. Then press the button on the bottom to change the Name property of the parent row.


Regards,
Boris Penev
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Dean
Top achievements
Rank 1
Answers by
Boris
Telerik team
Share this question
or