Can I Rebind Chart with asynchronous way?

2 posts, 0 answers
  1. yiwei
    yiwei avatar
    1 posts
    Member since:
    Jul 2011

    Posted 26 Aug 2011 Link to this post


    I have a method that use asynchronous way.

    I want to update the PaletteBrushes when some data has already been prepared.

    But the PaletteBrushes doesn't updated after i invoke the  asynchronous method.

    Is there any way to meet my requirement?

  2. Yavor
    Yavor avatar
    11 posts

    Posted 31 Aug 2011 Link to this post

    Hello Yiwei,

    You can rebind the chart to handle this scenario. This may look something like this:

    public CurrentIssue()
              RadChart.ItemsSource = new int[] {123, 4, 5, 6, 7, 78};
              DispatcherTimer timer = new DispatcherTimer();
              timer.Interval = new TimeSpan(0, 0, 3);
              timer.Tick += new EventHandler(timer_Tick);
          void timer_Tick(object sender, EventArgs e)
              RadChart.PaletteBrushes.Add(new SolidColorBrush(Colors.Red));
              (sender as DispatcherTimer).Stop();

    I hope this information helps.

    Best wishes,
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top