SwitchGridVisibility is not defined for RadDiagram

5 posts, 0 answers
  1. Saher
    Saher avatar
    20 posts
    Member since:
    Jul 2013

    Posted 31 Jul 2013 Link to this post

     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
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 05 Aug 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Saher
    Saher avatar
    20 posts
    Member since:
    Jul 2013

    Posted 05 Aug 2013 Link to this post

    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
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 Aug 2013 Link to this post

    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 >>
  6. Saher
    Saher avatar
    20 posts
    Member since:
    Jul 2013

    Posted 07 Aug 2013 Link to this post

    Thanks a lot for your response. This worked.

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

    Best,
    Saher
Back to Top
DevCraft banner