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.

WPF Adornment Redraw Issue When Chart is On a TabControl

Thread ID:

Created:

Updated:

Platform:

Replies:

109381 Jun 10,2013 04:24 PM Jun 18,2013 05:15 AM WPF 3
loading
Tags: Chart
Troy Magennis
Asked On June 10, 2013 04:24 PM

I have a WPF application and a chart on tab on a tabcontrol.

1. The user enters some data and clicks a button.
2. The application computes some data and assigned the List<T> to a series on the chart control in C#.
3. Initially the chart control isn't visible (on another tab)
4. The user clicks on the tab and the chart series and axis are perfectly drawn - HOWEVER no Adornments are shown.
5. If the user returns to the original tab and clicks computer again, the same assignment code of the series datasource is run again. (same method)
6. If the user clicks on the chart tab, the chart is correctly drawn WITH the adornments shown.

Unless the chart has drawn once before (been made visible by the client bound to the actual data), adornments aren't drawn. Just binding twice didn't fix it. Unless the chart control was seen by the user, re-binding new data didn't solve the problem.

Code example is too big to send. I may be able to reproduce, but thought i'd ask if you had seen redraw issues like this when charts are on non-visible tabs initially.

Troy

Sheik Syed Abthaheer M [Syncfusion]
Replied On June 12, 2013 05:51 AM

Hi Troy,

 

Thanks for using Syncfusion products.

 

We have analyzed your query and we are unable to reproduce the issue at our end. We have prepared the sample based on your requirement. Please find the sample in the below location. If problem still persist, then please modify the below sample in order to reproduce the issue. So that, it will be helpful for us to serve you better.

 

Please let us know if you have queries.

 

Regards,

M. Sheik




WPFChartWithTapControl_ec42e7a0.zip

Troy Magennis
Replied On June 14, 2013 05:08 PM

Thanks.

I tried to replicate it in a smaller app to no avail.

It still happens in our main application. But can't expect you to diagnose it without a repro case. Thanks for trying.

As a workaround: What is the c# code that would force a complete redraw of the chart and all of its series. I'll hook it up to the tab focus event and see if that works.

Troy

Sheik Syed Abthaheer M [Syncfusion]
Replied On June 18, 2013 05:15 AM

Hi Troy,

Thanks for your update.

In order to redraw the chart completely in an event, we can use chart UpdateLayout method as shown in the given code snippet.

Code snippet[C#]:

Chart.UpdateLayout();

Please let us know if you have any queries.

Regards,

M. Sheik


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.

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.

;