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()

    Declaration
    public Lane()

    Lane(Lane)

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

    Properties

    Children

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

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

    Header

    Gets or sets the header of the lane.

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

    The header defines the title of the lane.

    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

    The orientation of the Lane.

    Remarks

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

    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

    The style of the lane.

    Remarks

    Use this property to apply custom styling to the lane, such as background color, stroke color, or stroke dash array.

    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