Hi,
I am trying the following, I have a diagram that contains nodes, those are using the card component to be rendered. I started with one of your example :
https://www.syncfusion.com/forums/158986/dragging-nodes-to-create-and-delete-connections
and made some adjustments :
<SfDiagram Width="1000px" Height="@Height" @ref="@diagram" Nodes="nodes">
<DiagramEvents OnDrop="@OnDrop" SelectionChanged="@SelectionChange"></DiagramEvents>
<DiagramTemplates>
<NodeTemplate>
@{
var noeudDirection = context as Node;
if (noeudDirection.Data.Contains("|"))
{
<SfCard ID="@((context as Node).Id)">
<CardHeader Title="@(noeudDirection.Data.Split("|")[0])" SubTitle="@(noeudDirection.Data.Split("|")[1])" ImageUrl=@(noeudDirection.Data.Split("|")[2]) />
</SfCard>
}
else
{
<SfCard ID="@((context as Node).Id)">
<CardHeader Title="@((context as Node).Data)" ImageUrl="@((context as Node).Data)" />
</SfCard>
}
}
</NodeTemplate>
</DiagramTemplates>
</SfDiagram>
and
protected override void OnInitialized()
{
Palettes = new ObservableCollection<SymbolPalettePalette>();
nodes = new ObservableCollection<DiagramNode>();
data.Add("Mass", 15);
data.Add("Pressure", 50);
data.Add("Velocity", 30);
DiagramNode node1 = new DiagramNode()
{
Id = "node1",
Height = 100,
Width = 100,
OffsetX = 300,
OffsetY = 100
};
node1.Constraints = NodeConstraints.Default | NodeConstraints.AllowDrop;
nodes.Add(node1);
basicShapes = new ObservableCollection<Object>()
{
new DiagramNode()
{
Id = "Rectangle",
Shape = new DiagramShape() { Type = Shapes.Basic, BasicShape = Syncfusion.Blazor.Diagrams.BasicShapes.Rectangle },
AddInfo = data
},
};
Palettes.Add(new SymbolPalettePalette() { Id = "BasicShapes", Expanded = true, Symbols = basicShapes, Title = "Basicshapes" });
}
Now look what happens in the console when I do the following steps :
1- Drag a new node
2- Move the first node around
3- Drop the new node into the node 1 :
The exception appears and the event will not be triggered.
Can you reproduce and gives some advice as how to mitigate that error?
Thanks
Hi Nicolas,
We are validating your requirement and update you with more details within two business days.
Regards,
Arun Kumar
Hi
Arun,
Did you successfully reproduce the issue ?
Hi Nicolas,
We have logged “An Exception raises when dragging and dropping node over another node in the diagram” as a defect. The fix for this issue will be included in our weekly patch release February 23, 2022 and we will provide you the feedback link by tomorrow to track the status of this bug.
Regards,
Arun Kumar.
Hi Nicolas,
Sorry for the inconvenience caused.
We have fixed the issue and testing the issue in various scenarios. However, we will include the fix in our next weekly patch release which is tentatively scheduled to release on March 2, 2022.
Regards,
Arun Kumar.
Hi Nicolas,
We have fixed the reported issue and included it in our latest patch release which is rolled out successfully.
Please upgrade to the
latest NuGet version to resolve this issue.
Regards
Arun Kumar.