File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
UG-Samples/Swimlanes/Lane/AllowDragWithinSwimlane/AllowDragWithinSwimlane/Pages Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 11@page " /"
22
33@using Syncfusion .Blazor .Diagram
4+ @using TextOverflow = Syncfusion .Blazor .Diagram .TextOverflow
5+ @using TextWrap = Syncfusion .Blazor .Diagram .TextWrap
46
5- <SfDiagramComponent Height =" 600px" Swimlanes =" @SwimlaneCollections" NodeCreating =" @OnNodeCreating" >
7+ <button onclick =" @AllowDrag" >AllowDrag</button >
8+ <SfDiagramComponent @ref =" diagramComponent" Height =" 600px" Swimlanes =" @SwimlaneCollections" NodeCreating =" @OnNodeCreating" >
69 <SnapSettings Constraints =" SnapConstraints.None" ></SnapSettings >
710</SfDiagramComponent >
811
912@code
1013{
14+ SfDiagramComponent diagramComponent ;
1115 // Define diagram's swimlane collection
1216 DiagramObjectCollection <Swimlane > SwimlaneCollections = new DiagramObjectCollection <Swimlane >();
1317
102106 };
103107 }
104108 }
109+ public void AllowDrag ()
110+ {
111+ if (diagramComponent .SelectionSettings .Nodes .Count > 0 )
112+ {
113+ if (diagramComponent .SelectionSettings .Nodes [0 ].Constraints .HasFlag (NodeConstraints .AllowDragWithinSwimlane ))
114+ {
115+ diagramComponent .SelectionSettings .Nodes [0 ].Constraints &= ~ NodeConstraints .AllowDragWithinSwimlane ;
116+
117+ }
118+ else
119+ {
120+ diagramComponent .SelectionSettings .Nodes [0 ].Constraints |= NodeConstraints .AllowDragWithinSwimlane ;
121+ }
122+ }
123+ }
105124}
You can’t perform that action at this time.
0 commit comments