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

Disable scrolling to top when adding new item to bound collection

3 Answers 305 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 09 Apr 2015, 08:16 PM

Hi,

 

When I add a new item to the bound collection in my view model the radgridview scrolls to the top on its own.

How to prevent this from happening ? I saw a similar thread with no solution : http://www.telerik.com/forums/disable-scroll-on-changing-collection

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 10 Apr 2015, 12:24 PM
Hello Manoj,

Generally, the ScrollBar is Reset as a CollectionChanged notification with action Reset is raised for the source collection. If the Action is Add or Remove, then it should stay as it is. Would you please subscribe for the CollectionChanged event and check what the e.Action it? 

Regards,
Dimitrina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Manoj
Top achievements
Rank 1
answered on 15 Apr 2015, 09:55 AM

I am adding aggregate functions when data loaded event happens. Looks like that is causing the scroll back to top.

I am now adding it only once initially. This solves the issue.

0
Dimitrina
Telerik team
answered on 15 Apr 2015, 11:13 AM
Hi,

Thank you for sharing the solution you came up with the community. 

Regards,
Dimitrina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
GridView
Asked by
Manoj
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or