menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DiagramGridLines - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DiagramGridLines

    Represents the visual guidance while dragging or arranging the objects.

    Inheritance
    System.Object
    DiagramGridLines
    HorizontalGridLines
    VerticalGridLines
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DiagramGridLines : OwningComponentBase
    Examples
    <SfDiagramComponent>
        <SnapSettings Constraints="SnapConstraints.ShowLines">
            <HorizontalGridLines LineColor="blue" LineDashArray="2,2" LineIntervals="@LineInterval">
            </HorizontalGridLines>
            <VerticalGridLines LineColor="blue" LineDashArray="2,2" LineIntervals="@LineInterval">
            </VerticalGridLines>
        </SnapSettings>
    </SfDiagramComponent>
    @code
    {
       //Set the line intervals for the grid lines
       public double[] LineInterval { get; set; } = new double[] 
       {
            1.25, 14, 0.25, 15, 0.25, 15, 0.25, 15, 0.25, 15
       };
    }

    Constructors

    DiagramGridLines()

    Declaration
    public DiagramGridLines()

    Properties

    DotIntervals

    Represents the pattern of gaps defined by a set of dots.

    Declaration
    public double[] DotIntervals { get; set; }
    Property Value
    Type Description
    System.Double[]

    The default vaule is { 1, 19, 0.5, 19.5, 0.5, 19.5, 0.5, 19.5, 0.5, 19.5 }

    Examples
    <SfDiagramComponent>
        <SnapSettings Constraints="SnapConstraints.ShowLines">
            <HorizontalGridLines  DotIntervals="@DotInterval">
            </HorizontalGridLines>
            <VerticalGridLines  DotIntervals="@DotInterval">
            </VerticalGridLines>
        </SnapSettings>
    </SfDiagramComponent>
    @code
    {
       //Set the Dot intervals for the grid lines
       public double[] DotInterval { get; set; } = new double[] 
       {
            1.25, 14, 0.25, 15, 0.25, 15, 0.25, 15, 0.25, 15
       };
    }

    DotIntervalsChanged

    Specifies the callback to trigger when the dot intervals changes.

    Declaration
    public EventCallback<double[]> DotIntervalsChanged { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.EventCallback<System.Double[]>

    LineColor

    Defines the color of the horizontal or vertical grid lines.

    Declaration
    public string LineColor { get; set; }
    Property Value
    Type Description
    System.String

    The default color is LIGHTGRAY

    Examples
    <SfDiagramComponent>
        <SnapSettings Constraints="SnapConstraints.ShowLines">
            <HorizontalGridLines LineColor="blue" >
            </HorizontalGridLines>
            <VerticalGridLines LineColor="blue">
            </VerticalGridLines>
        </SnapSettings>
    </SfDiagramComponent>
    @code
    {
    }

    LineColorChanged

    Specifies the callback to trigger when the line color changes.

    Declaration
    public EventCallback<string> LineColorChanged { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.EventCallback<System.String>

    LineDashArray

    Defines the pattern of dashes and gaps in the horizontal or vertical grid lines.

    Declaration
    public string LineDashArray { get; set; }
    Property Value
    Type Description
    System.String

    The default value is empty

    Examples
     <SfDiagramComponent>
        <SnapSettings Constraints="SnapConstraints.ShowLines">
            <HorizontalGridLines LineDashArray="2" >
            </HorizontalGridLines>
            <VerticalGridLines LineDashArray="2">
            </VerticalGridLines>
        </SnapSettings>
    </SfDiagramComponent>
    @code
    {
    }

    LineDashArrayChanged

    Specifies the callback to trigger when the line dash array changes.

    Declaration
    public EventCallback<string> LineDashArrayChanged { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.EventCallback<System.String>

    LineIntervals

    The thickness and the space between horizontal/vertical grid lines can be customized by using line intervals.

    Declaration
    public double[] LineIntervals { get; set; }
    Property Value
    Type Description
    System.Double[]

    The default vaule is { 1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75 }

    Examples
     <SfDiagramComponent>
        <SnapSettings Constraints="SnapConstraints.ShowLines">
            <HorizontalGridLines  LineIntervals="@LineInterval">
            </HorizontalGridLines>
            <VerticalGridLines  LineIntervals="@LineInterval">
            </VerticalGridLines>
        </SnapSettings>
     </SfDiagramComponent>
    @code
    {
       //Set the line intervals for the grid lines
       public double[] LineInterval { get; set; } = new double[] 
       {
            1.25, 14, 0.25, 15, 0.25, 15, 0.25, 15, 0.25, 15
       };
    }

    LineIntervalsChanged

    Specifies the callback to trigger when the line intervals changes.

    Declaration
    public EventCallback<double[]> LineIntervalsChanged { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.EventCallback<System.Double[]>

    SnapIntervals

    Specifies a set of intervals for snapping the objects. By default, the objects are snapped towards the nearest grid line.

    Declaration
    public double[] SnapIntervals { get; set; }
    Property Value
    Type Description
    System.Double[]

    The default vaule is { 20 }

    Examples
     <SfDiagramComponent>
        <SnapSettings Constraints="SnapConstraints.ShowLines">
            <HorizontalGridLines SnapIntervals="30" >
            </HorizontalGridLines>
            <VerticalGridLines SnapIntervals="30" >
            </VerticalGridLines>
        </SnapSettings>
    </SfDiagramComponent>
    @code
    {
    }

    SnapIntervalsChanged

    Specifies the callback to trigger when the snap intervals changes.

    Declaration
    public EventCallback<double[]> SnapIntervalsChanged { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.EventCallback<System.Double[]>

    Methods

    Dispose()

    This method releases all unmanaged resources.

    Declaration
    public void Dispose()

    OnAfterRenderAsync(Boolean)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender

    Set to true for the first time component rendering; otherwise gets false.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    OnParametersSetAsync()

    Method invoked when any changes in component state occurs.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ="Task".

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved