Only major grid

Is it possible to display only major grid lines?
I am displaying minor and major dots and when the user zooms out the minor grid becomes so dense that I would like to stop drawing the minor grid and leave the major grid until the user zooms out so much, that no grid is necessary. Not drawing the minor grid when zoomed out should also improve the performance.

You could add a GoView.PropertyChanged event handler that checks for new values of “DocScale”. As the value gets smaller you could change the nature of the GridStyle.

I’m already doing this, but I don’t know how to hide minor grid and draw only major grid. Modifying GridStyle changes settings for both minor and major grid.
My code looks like this:

    ///<summary>Hides the grid for small scales to avoid performance problems</summary>
    private void ScaleGrid(float scale)
    {
        if (scale < 0.49f)
        {
            //hide the grid for small scales
            GridStyle = GoViewGridStyle.None;
        }
        else if (scale < 1.1f)
        {
            GridStyle = GoViewGridStyle.Dot;

            //keep grid dot size always 1 pixel even if zoomed out
            GridLineWidth = 0;
            GridMajorLineWidth = 0;
        }
        else
        {
            GridStyle = GoViewGridStyle.Dot;

            //keep grid dot size always 1 document point, it will grow when zoomed in
            GridLineWidth = 1;
            GridMajorLineWidth = 1;
        }
    }

There is more to it than that, sorry.

example: GridCellSize: 50,50, GridMajorLineFreq: 5,5
when zoomed, change to 250,250 and 1,1
this will cause all the "minor" grids to disappear.
You can play with this in Demo1 using the Properties grid and using Ctrl-Mousewheel to zoom.

The problem is that I don’t want to change the grid size. All link routing and node positioning relies on the minor grid.

You can set GridLineColor to Transparent. This gets rid of the minor grid visually, but I’m not sure how much it speeds things up. Depends on how smart the video driver is, I’d guess.

Unfortunately this doesn’t avoid the performance problems. I have an Nvidia 9400GT.
What about implementing a new feature in GoDiagram? Adding a flag to turn off the minor grid shouldn’t be much hassle. Such a basic feature should have been added a long time ago, together with major grid functionality.

Any plans of enhancing the grid?

Not in the upcoming release.

Actually, we did add an enhancement for this issue in the upcoming 4.0 release. GoGrid.PaintMinorScale allows you to set a minimum scale factor where the minor grid will be painted.

Fantastic!!!
I will upgrade to GoDiagram 4.0 soon after its release.
Well done Clap