Skip to content

Commit e201e45

Browse files
authored
982382: Documentation for Allow drag within swimlane
1 parent 9ee1f3a commit e201e45

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

blazor/diagram/swimlane/lane/interaction.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The following image shows children interaction in lane.
5050

5151
## How to restrict nodes from being dragged or repositioned outside their assigned swimlane
5252

53-
To restrict child nodes to their swimlane, set their [Constraints](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.Node.html#Syncfusion_Blazor_Diagram_Node_Constraints) to include [NodeConstraints.AllowDragWithinSwimlane](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.NodeConstraints.html#Syncfusion_Blazor_Diagram_NodeConstraints_AllowDragWithinSwimlane). By default, nodes can move freely; however, with this constraint enabled, a node can only be dragged within the bounds of its owning swimlane. Attempts to move it across lane or swimlane boundaries are prevented.
53+
To restrict child nodes to their swimlane, set their [Constraints](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.Node.html#Syncfusion_Blazor_Diagram_Node_Constraints) to include **NodeConstraints.AllowDragWithinSwimlane**. By default, nodes can move freely; however, with this constraint enabled, a node can only be dragged within the bounds of its owning swimlane. Attempts to move it across lane or swimlane boundaries are prevented.
5454

5555
The following example demonstrates one node restricted to its swimlane, while another remains unrestricted for comparison.
5656

@@ -64,7 +64,7 @@ The following example demonstrates one node restricted to its swimlane, while an
6464
@code
6565
{
6666
//Define diagram's swimlane collection
67-
DiagramObjectCollection<Swimlane> SwimlaneCollections = new DiagramObjectCollection<Swimlane>();
67+
private DiagramObjectCollection<Swimlane> SwimlaneCollections = new DiagramObjectCollection<Swimlane>();
6868
6969
protected override void OnInitialized()
7070
{
@@ -101,7 +101,7 @@ The following example demonstrates one node restricted to its swimlane, while an
101101
Width = 100,
102102
LaneOffsetX = 100,
103103
LaneOffsetY = 30,
104-
//Enable AllowDragWithinSwimlane to restrict movement outside the swimlane
104+
// To enable AllowDragWithinSwimlane to restrict movement outside the swimlane
105105
Constraints = NodeConstraints.Default | NodeConstraints.AllowDragWithinSwimlane ,
106106
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
107107
{
@@ -129,10 +129,10 @@ The following example demonstrates one node restricted to its swimlane, while an
129129
if (obj is Swimlane swimlane)
130130
{
131131
swimlane.Header.Style = new TextStyle()
132-
{
133-
Fill = "#5b9bd5",
134-
StrokeColor = "#5b9bd5"
135-
};
132+
{
133+
Fill = "#5b9bd5",
134+
StrokeColor = "#5b9bd5"
135+
};
136136
foreach (Phase phase in swimlane.Phases)
137137
{
138138
phase.Style = new ShapeStyle() { Fill = "#5b9bd5", StrokeColor = "#5b9bd5" };
@@ -145,10 +145,10 @@ The following example demonstrates one node restricted to its swimlane, while an
145145
else if (obj is Node node)
146146
{
147147
node.Style = new ShapeStyle()
148-
{
149-
Fill = "#5b9bd5",
150-
StrokeColor = "#5b9bd5"
151-
};
148+
{
149+
Fill = "#5b9bd5",
150+
StrokeColor = "#5b9bd5"
151+
};
152152
}
153153
}
154154
}
@@ -159,7 +159,7 @@ A complete working sample can be downloaded from [GitHub](https://github.com/Syn
159159
![Allow Drag Within Swimlane](../Swimlane-images/AllowDragWithinSwimlane.gif)
160160

161161
>**Note:**
162-
* To restrict a node to its owning swimlane, add [NodeConstraints.AllowDragWithinSwimlane](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.NodeConstraints.html#Syncfusion_Blazor_Diagram_NodeConstraints_AllowDragWithinSwimlane) to the node’s `Constraints` property.
162+
* To restrict a node to its owning swimlane, add **NodeConstraints.AllowDragWithinSwimlane** to the node’s `Constraints` property.
163163

164-
* To enforce this restriction for all child nodes within swimlanes, set the [Constraints](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.Node.html#Syncfusion_Blazor_Diagram_Node_Constraints) during node initialization in the NodeCreating event.
164+
* To enforce this restriction for all child nodes within swimlanes, set the [Constraints](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.Node.html#Syncfusion_Blazor_Diagram_Node_Constraints) during node initialization in the [NodeCreating](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_NodeCreating) event.
165165

0 commit comments

Comments
 (0)