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.
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:

Created:

Updated:

Platform:

Replies:

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

Hello,

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,
Alexandru.

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:SfChart.Legend> 
       <syncfusionChart:ChartLegend > 
            <syncfusionChart:ChartLegend.ItemsPanel> 
                         <ItemsPanelTemplate> 
                                <WrapGrid Orientation="Horizontal" 
                                          MaximumRowsOrColumns="2" 
                                          ItemWidth="150" /> 
                         </ItemsPanelTemplate> 
            </syncfusionChart:ChartLegend.ItemsPanel>             
       </syncfusionChart:ChartLegend> 
</syncfusionChart:SfChart.Legend> 
  
We have prepared a sample with reference of attached sample and it can be downloaded from below link, 
  
Sample: PieScrolling 
  
Regards, 
Devi 





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,
Alexandru.

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. 
  
Regards, 
Devi 


CONFIRMATION

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.

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

;