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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Specify gridline spacing

Thread ID:





117013 Jul 18,2014 06:56 PM UTC Jul 23,2014 03:12 PM UTC WPF 3
Tags: Diagram
Asked On July 18, 2014 06:56 PM UTC

I would like the spacing between horizontal and vertical gridlines to be the same as, or a multiple of, the diagram view's SnapOffsetX and SnapOffsetY.  Is there a property I can use to set the spacing of gridlines?

Saranya Chandrasekaran [Syncfusion]
Replied On July 22, 2014 03:57 AM UTC

Hi Jeff,

Regarding “Property for spacing between horizontal and vertical gridlines”, your requirement have been achieved by using GridHorizontalOffset and GridVerticalOffset Properties.

Please refer to the following online help documentation link for more information about Gridlines Property.


Link: http://help.syncfusion.com/ug/wpf/documents/gridlines.htm


Please let us know if you have any concerns.


Saranya C

Replied On July 22, 2014 02:46 PM UTC

Thank you for helping me find the answer in the documentation.


Should anyone else ever read this post, here is some additional useful information:

GridLineHorizontalOffset and GridLineVerticalOffset are properties of the DiagramPage class.  DiagramView contains a property whose implementation is DiagramPage, but the property casts the DiagramPage to Panel before returning it. Therefore, in order to access the unique properties of DiagramPage, you must cast the DiagramView.Page property. 



Here is the code that worked for me.  Note that diagramView1 is a pre-existing reference to the relevant DiagramView:

var diagramPage = diagramView1.Page as DiagramPage;
diagramPage.GridHorizontalOffset = 12;
diagramPage.GridVerticalOffset = 12;


The documentation for DiagramPage.GridHorizontalOffset and .GridVerticalOffset contains code examples to a similar effect.


Mohana Priya Raja [Syncfusion]
Replied On July 23, 2014 03:12 PM UTC

Hi Jeff,

Thanks update with the technical acknowledgement.

Please let us know if you have any concerns
MohanaPriya R


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon