We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Avoid scrolling to top when updating SfChart which has a legend

Thread ID:





129281 Mar 9,2017 12:40 PM UTC Mar 13,2017 03:42 AM UTC UWP 3
Tags: SfChart
Alexandru Pastor Opris
Asked On March 9, 2017 12:40 PM UTC


The problem is that we've got a long page with a vertical scrollbar which contains a Pie Chart with a legend, and at the bottom a simple button which adds a new item to the items source of the chart.
Once we update the items source of the chart, it updates the chart correctly and seems to automatically set the focus to the legend and scroll us to the top of the page, our question is if we could avoid this scroll behaviour and just keep the scroll where we are.

I've attached a sample with the problem.
What is also strange is that if we don't have the legend it doesn't jump to the top, but we need to have that legend.

Have a nice day,

Attachment: AvoidScrollSample_461e9f09.zip

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On March 10, 2017 09:23 AM UTC

Hi Alexandru, 
Thanks for contacting Syncfusion Support. 
The reported problem is occurred due to ItemWrapGrid used in the ItemsPanelTemplete of legend.  We can avoid this problem by using WrapGrid in the ItemsPanelTemplate instead of ItemWrapGrid as shown in the below code snippet, 

       <syncfusionChart:ChartLegend > 
                                <WrapGrid Orientation="Horizontal" 
                                          ItemWidth="150" /> 
We have prepared a sample with reference of attached sample and it can be downloaded from below link, 
Sample: PieScrolling 

Alexandru Pastor Opris
Replied On March 10, 2017 09:35 AM UTC

Hello Devi,

Thank you so much, that indeed worked perfectly.

Have a nice day,

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On March 13, 2017 03:42 AM UTC

Hi Alexandru, 
Thanks for your update. 
Please let us know, if you need any further assistance on this. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon