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. Image for the cookie policy date

Grid spacing

The View.Grid.VerticalSpacing and View.Grid.HorizontalSpacing properties was "float" in the V4, "int" in the V5. It's a problem for my application because I need a precise number of grid cells in a sizable surface.

Thanks.

1 Reply

MF Meera Fathima Syncfusion Team May 16, 2007 11:56 AM UTC



Hi Graingeot,

Yes, as with the new version of Diagram, the LayoutGrid.HorizontalSpacing/VerticalSpacing properties are of int type. We will analyze about making these properties to float type and do the changes accordingly. Please create a DT incident with the subject of this forum .

Also you can achieve this requirement by customizing the LayoutGrid,View and Diagram classes and overriding the desired methods and properties.

I have created a sample that uses the HorizontalSpacing and VerticalSpacing properties of float type. You can download the sample from the following link - http://websamples.syncfusion.com/samples/Diagram.Windows/F60943/Main.htm

Sample Details :

1. MyLayoutGrid is the custom class created from the LayoutGrid. It provides the new HorizontalSpacing and VerticalSpacing properties of float type and overrides DrawLineGrid(),DrawVerticalLines() and DrawHorizontalLines() methods that use the new horizontal and vertical spacing properties.

2. MyView is the custom class created from the View class. It provides a LayoutGrid property of MyLayoutGrid type. And it overrides the Draw() method that calls the MyLayoutGrid.Draw() method .

3. MyDiagram is the custom class created from the diagram class. It overrides the CreateView(0 method that is used to create the view of MyView type.

4. The sample uses MyDiagram class instead of the default diagram.

In this sample, the view uses line type gridstyle. And hence DrawLineGrid(),DrawVerticalLines() and DrawHorizontalLines() methods in the MyLayoutGrid class have been customized and the new HorizontalSpacing and VerticalSpacing properties of float type are used in this methods.

If you want to use the point type grid style, please override the DrawPointGrid() and DrawPoints() methods and use the new HorizontalSpacing and VerticalSpacing properties of float type in this method.

I hope the above informations will help you. Please let me know if you have any more questions regarding this.

Thanks,
Meera.

Loader.
Live Chat Icon For mobile
Up arrow icon