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

Losing Measurement units and grid lines when both defined in xaml using C# .net 4.0 vs 2010

Thread ID:





107312 Feb 25,2013 06:07 AM UTC Feb 25,2013 09:38 AM UTC WPF 1
Tags: Diagram
Alan Burch
Asked On February 25, 2013 06:07 AM UTC

I'm trying WPF diagram and the following code taken from a search of MeasurementUnits doesn't show both the grid lines and ruler measurement units at the same time. It shows only the measurement in inches but the grid lines disappear. What is wrong to cause this? Regards... Al

xaml code follows that I am using in for the WPF diagram

<Grid Grid.Column="2" Grid.RowSpan="3" Height="Auto" HorizontalAlignment="Left" Name="gridDiagram" VerticalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="2">
                <syncfusion:DiagramControl Name="Schematic_Diagram"  Background="White" Grid.Column="2" Grid.RowSpan="3">
                        <syncfusion:DiagramModel x:Name="diagramModel">
                        <syncfusion:DiagramView x:Name="diagramView" ShowHorizontalGridLine="True" ShowVerticalGridLine="True">
                            <syncfusion:DiagramPage x:Name="diagramPage" MeasurementUnits="Inch">
                                <syncfusion:HorizontalRuler />
                                <syncfusion:VerticalRuler />

Sudhakar C [Syncfusion]
Replied On February 25, 2013 09:38 AM UTC

Hi Alan,

By default,  the grid lines are created based on the pixel values and also the default value of the GridHorizantal offset & Grid Vertical offset of the Diagram Page are such as 25,25 pixels (The grid lines are starting from 25 pixels). So that we can’t view the Grid Lines. However, If you want to view the Grid Lines, please change the GridHorizantalOffset and GridVerticalOffset Values based on the Measurement unit which you are using (if you change the Measurement unit). For more information please refer the following code snippet to set the  GridHorizantalOffset and GridVerticalOffset. Now, the Grid Lines will be create based on the Measurement unit which you are using.

Code Snippet :

(diagramView.Page as DiagramPage).GridHorizontalOffset = MeasureUnitsConverter.FromPixels((diagramView.Page as DiagramPage).GridHorizontalOffset, (diagramView.Page as DiagramPage).MeasurementUnits);


//Set the GridVerticalOffset

(diagramView.Page as DiagramPage).GridVerticalOffset = MeasureUnitsConverter.FromPixels((diagramView.Page as DiagramPage).GridVerticalOffset, (diagramView.Page as DiagramPage).MeasurementUnits);


Please let us know if you require further assistance on this.


Sudhakar C


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

This page will automatically be redirected to the 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