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

Change individual Pointmark visibility at runtime

3 Answers 67 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 23 Mar 2011, 04:17 PM
Hi,
Is there any way to access an individual pointmark and change its visibility at runtime? 
Mike

3 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 24 Mar 2011, 04:04 PM
Anyone know if this is possible?

Mike
0
Giuseppe
Telerik team
answered on 25 Mar 2011, 02:33 PM
Hello Mike,

There are two approaches that would allow you to customize the visibility of individual pointmarks at runtime:
  • Using the MVVM pattern as demonstrated on this demo here (basically you need to re-template the Line visual element and substitute the default PointMark.Visibility template binding there with custom Binding expression to a property in your ViewModel; then any modification to the ViewModel property at runtime, is immediately propagated to the point mark itself.
  • Alternatively you can take advantage of our UIElement.ChildrenOfType<T>() extension method and directly access the PointMark visuals to toggle their visibility.

We have attached two sample applications that demonstrate both approaches for your reference.


Regards,
Giuseppe
the Telerik team
0
Mike
Top achievements
Rank 1
answered on 25 Mar 2011, 04:35 PM
Thanks Giuseppe,

I'll give them a try.

Mike
Tags
Chart
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or