menu

Blazor

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

    Show / Hide Table of Contents

    Class Lane

    Represents a lane in a swimlane, which is a functional unit or responsible department within a business process.

    Inheritance
    System.Object
    DiagramObject
    NodeBase
    SwimlaneChild
    Lane
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    NodeBase.AdditionalInfo
    NodeBase.CanAutoLayout
    NodeBase.Flip
    NodeBase.FlipMode
    NodeBase.ID
    NodeBase.IsVisible
    NodeBase.Margin
    NodeBase.SearchTags
    NodeBase.Tooltip
    NodeBase.ZIndex
    SwimlaneChild.Height
    SwimlaneChild.Width
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class Lane : SwimlaneChild, IDiagramObject, ICloneable
    Remarks

    A lane helps to map and define a specific part of the process within the functional unit or between multiple functional units. Lanes are typically used in swimlanes to visually organize and allocate tasks or activities to different individuals or groups.

    Examples

    The following example demonstrates how to add a lane to a swimlane:

     
    
    <SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections"> 
    </SfDiagramComponent> 
    @code {
       DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>(); 
    
       protected override void OnInitialized() 
       { 
           Node node1 = new Node() 
           { 
               ID = "node1", 
               Height = 100, 
               Width = 100, 
               OffsetX = 100, 
               OffsetY = 100, 
           }; 
           Node node2 = new Node() 
           { 
               ID = "node2", 
               Height = 100, 
               Width = 100, 
               OffsetX = 300, 
               OffsetY = 100, 
           }; 
           swimlaneCollections = new DiagramObjectCollection<Swimlane>() 
           { 
               new Swimlane() 
               { 
                   ID = "swimlane1", 
                   Orientation = Orientation.Horizontal, 
                   Height = 200, 
                   Width = 450, 
                   Lanes = new DiagramObjectCollection<Lane>() 
                   { 
                       new Lane() 
                       { 
                           Header = new SwimlaneHeader () 
                           { 
                               Annotation = new Annotation() 
                               { 
                                   Content = "Header of lane" 
                               } 
                           }, 
                           Height = 100, 
                           Children = new DiagramObjectCollection<Node>() 
                           { 
                               node1, node2 
                           } 
                       } 
                   } 
               } 
           }; 
       } 
    } 

    Constructors

    Lane()

    Initializes a new instance of the Lane class with default values.

    Declaration
    public Lane()

    Lane(Lane)

    Initializes a new instance of the Lane class by copying an existing instance.

    Declaration
    public Lane(Lane src)
    Parameters
    Type Name Description
    Lane src

    The source Lane instance to copy from.

    Properties

    Children

    Gets or sets the collection of child nodes in the lane.

    Declaration
    public DiagramObjectCollection<Node> Children { get; set; }
    Property Value
    Type Description
    DiagramObjectCollection<Node>

    A DiagramObjectCollection<T> representing the nodes contained within this lane. The default value is an empty collection.

    Remarks

    This property holds all the nodes that are part of a specific lane in the diagram, allowing you to manage and access the children separately.

    Examples
    <SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections">
    </SfDiagramComponent>
    @code {
        DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>();
        protected override void OnInitialized()
        {
            Node node1 = new Node()
            {
                ID = "node1",
                Height = 100,
                Width = 100,
                OffsetX = 100,
                OffsetY = 100,
            };
            Node node2 = new Node()
            {
                ID = "node2",
                Height = 100,
                Width = 100,
                OffsetX = 300,
                OffsetY = 100,
            };
            swimlaneCollections = new DiagramObjectCollection<Swimlane>()
            {
                new Swimlane()
                {
                    ID = "swimlane1",
                    Orientation = Orientation.Horizontal,
                    Height = 200,
                    Width = 450,
                    Lanes = new DiagramObjectCollection<Lane>()
                    {
                        new Lane()
                        {
                            Header = new SwimlaneHeader()
                            {
                                Annotation = new Annotation()
                                {
                                    Content = "Header of lane"
                                }
                            },
                            Height = 100,
                            Children = new DiagramObjectCollection<Node>()
                            {
                                node1, node2
                            }
                        }
                    }
                }
            };
        }
    }

    Header

    Gets or sets the header of the lane.

    Declaration
    public SwimlaneHeader Header { get; set; }
    Property Value
    Type Description
    SwimlaneHeader

    A SwimlaneHeader that contains the header information of the lane. The default value is null.

    Remarks

    The header defines the title of the lane. It is essential for identifying the lane within the swimlane structure.

    Examples

    The following example demonstrates how to set the header of a lane:

    <SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections">
    </SfDiagramComponent>
    @code {
        DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>();
    
        protected override void OnInitialized()
        {
            Node node1 = new Node()
            {
                ID = "node1",
                Height = 100,
                Width = 100,
                OffsetX = 100,
                OffsetY = 100,
            };
            Node node2 = new Node()
            {
                ID = "node2",
                Height = 100,
                Width = 100,
                OffsetX = 300,
                OffsetY = 100,
            };
            swimlaneCollections = new DiagramObjectCollection<Swimlane>()
            {
                new Swimlane()
                {
                    ID = "swimlane1",
                    Orientation = Orientation.Horizontal,
                    Height = 200,
                    Width = 450,
                    Lanes = new DiagramObjectCollection<Lane>()
                    {
                        new Lane()
                        {
                            Header = new SwimlaneHeader()
                            {
                                Annotation = new Annotation()
                                {
                                    Content = "Header of lane"
                                }
                            },
                            Height = 100,
                            Children = new DiagramObjectCollection<Node>()
                            {
                                node1, node2
                            }
                        }
                    }
                }
            };
        }
    }

    Orientation

    Gets or sets the orientation of the Lane.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type Description
    Orientation

    An Orientation specifying the direction in which the Lane is displayed.

    Remarks

    The orientation specifies whether the lane is displayed horizontally or vertically. This property is applicable only when the lane is added to an SfSymbolPaletteComponent.

    Examples

    The following example demonstrates how to set the orientation of a Lane:

     
    
    <SfSymbolPaletteComponent Width="100%" Height="1000px" Palettes="@Palettes" SymbolHeight="50" 
    SymbolWidth="50"></SfSymbolPaletteComponent> 
    @code { 
        DiagramObjectCollection<Palette> Palettes = new DiagramObjectCollection<Palette>(); 
    
        protected override void OnInitialized() 
        { 
            // Horizontal lane
            Lane horizontalLane = new Lane() { Orientation = Orientation.Horizontal };  
    
            // Vertical lane
            Lane verticalLane = new Lane() { Orientation = Orientation.Vertical }; 
    
            DiagramObjectCollection<Nodebase> SymbolCollection = new DiagramObjectCollection<Nodebase>() 
            { horizontalLane, verticalLane };  
    
            Palettes = new DiagramObjectCollection<Palette>()  
            {  
                new Palette() { Symbols = SymbolCollection, Title = "Swimlane Shapes" }  
            }; 
        } 
    } 

    Style

    Gets or sets the style of the lane.

    Declaration
    public ShapeStyle Style { get; set; }
    Property Value
    Type Description
    ShapeStyle

    A ShapeStyle that holds the style settings for the lane, such as fill, stroke, and shadow styles. There is no default value; it must be set explicitly.

    Remarks

    Use this property to apply custom styling to the lane, which can include setting the background color, stroke color, stroke width, and defining shadow effects.

    Examples

    The following example demonstrates how to set the style of a lane:

    <SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections">
    </SfDiagramComponent>
    @code {
        DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>();
    
        protected override void OnInitialized()
        {
            swimlaneCollections = new DiagramObjectCollection<Swimlane>()
            {
                new Swimlane()
                {
                    ID = "swimlane1",
                    Orientation = Orientation.Horizontal,
                    Height = 200,
                    Width = 450,
                    Lanes = new DiagramObjectCollection<Lane>()
                    {
                        new Lane()
                        {
                            Header = new SwimlaneHeader ()
                            {
                                Annotation = new Annotation()
                                {
                                    Content = "Header of lane"
                                }
                            },
                            Style = new ShapeStyle()
                            {
                                Fill = "lightblue",
                                Stroke = "black",
                                StrokeWidth = 2,
                                Shadow = new ShadowStyle()
                                {
                                    Color = "gray",
                                    Blur = 5,
                                    OffsetX = 2,
                                    OffsetY = 2
                                }
                            },
                            Width = 450
                        }
                    }
                }
            };
        }
    }

    Methods

    Clone()

    Creates a new Lane that is a copy of the current Lane.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    A new Lane object that is a copy of this Lane.

    Overrides
    SwimlaneChild.Clone()

    Implements

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