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

SwitchGridVisibility is not defined for RadDiagram

4 Answers 82 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Saher
Top achievements
Rank 1
Saher asked on 31 Jul 2013, 06:57 PM

 am trying to switch off the grid visibility of a RadDiagram I have.

I am creating a User Control using Telerik controls within a Silverlight Project (sharing the control with a WPF Library).

It seems that RadDiagram Property is not found. (RadDiagram Commands - Found property here)

Question on StackOverflow: Telerik RadDaigram does not contain definition for SwitchGridVisibility

Is that an old release I have? If so, how can I update my assemblies. I really need to switch off the background grid from my RadDiagram shape.

PS: I am creating the shape programmatically so I need a solution that is either applied within Style attribute in ResourceDictionary or a programmatic property change.


Thanks,
Saher

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Aug 2013, 11:35 AM
Hi Saher,

 The way to turn off the BackGroundGrid or BackGroundPageGrid is to use these attached properties:

<telerik:RadDiagram x:Name="diagram" Margin="30"                           
                         primitives:BackgroundGrid.IsGridVisible="False"
                         primitives:BackgroundPageGrid.IsGridVisible="False"
                         ShapeTemplate="{StaticResource template}"
                         />
where primitives is defined like so:
xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Diagrams.Primitives;assembly=Telerik.Windows.Controls.Diagrams"
If you need to bind the command for switching the BackGroundGrid On / Off , you can use this syntax:
<telerik:RadButton Command="telerik:DiagramCommands.SwitchGridVisibility"
                         CommandTarget="{Binding ElementName=diagram}"/>
Let us know if this is what you need.
Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Saher
Top achievements
Rank 1
answered on 05 Aug 2013, 07:37 PM
Hello Petar,

Thanks for your response. I was wondering how I can do this programmatically? 
I create the RadDiagram object in code-behind, so how can I apply the grid visibility to be off in code behind?

Thanks a lot,
Saher
0
Petar Mladenov
Telerik team
answered on 06 Aug 2013, 07:05 AM
Hi Saher,

 So the question is more like "How to set attached properties in code behind". Here is the solution:

Telerik.Windows.Controls.Diagrams.Primitives.BackgroundGrid.SetIsGridVisible(this.diagram, false);
For more information about attached properties, please refer to this help article from MSDN.

Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Saher
Top achievements
Rank 1
answered on 07 Aug 2013, 08:29 PM
Thanks a lot for your response. This worked.

I commend your support team, you guys are quick in responses!

Best,
Saher
Tags
Diagram
Asked by
Saher
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Saher
Top achievements
Rank 1
Share this question
or