Hi,
I have the following issue with the diagram (classic) component, consider the following connector for my diagram:
ConnectorProjectBlaBlaBla = new ObservableCollection<DiagramConnector>();
foreach (User tempUser in listeOfUsers)
{
ConnectorProjectBlaBlaBla .Add(new DiagramConnector() { Id = $"connector{tempUser.Userid}", SourceID = $"node{userVIP}", TargetID = $"node{tempUser.displayName}", Visible = false });
}
}
Visible is set to false and so when run the sample looks originally like that:
So exactly what it is supposed to look like
Then I collapse the elements
Then I expand the nodes :
The property visible is reset to true for some reason :
Here is how the diagram is setup:
<SfDiagram @ref=diagramUsers ID="diagramUsers" Height="590px" ModelType="@model" Nodes="@NodeProjectUsers" Connectors="@ ConnectorProjectBlaBlaBla " NodeDefaults="@NodeDefaults" ConnectorDefaults="@ConnectorDefaults" Layout="@LayoutValue">
<DiagramSnapSettings Constraints="@snapConstraints">
<HorizontalGridlines LineColor="blue" LineDashArray="2,2">
</HorizontalGridlines>
<VerticalGridlines LineColor="blue" LineDashArray="2,2">
</VerticalGridlines>
</DiagramSnapSettings>
<DiagramTemplates>
<NodeTemplate>
<SfCard>
...
</SfCard>
</NodeTemplate>
</DiagramTemplates>
</SfDiagram>
I think the issue is that the node template is recreated once you expand the nodes but the javascript behind does not check the visibility set in the ConnectionCollection.
Also I get an exception when I expand:
Let me know if I am doing something wrong or if you can reproduce on your side.
Thanks
|
The visibility of the connector gets to true after expand and collapse. |
By default, while collapsing. We will set the visibility of the connectors to false and when expanded, we will set the visibility of the connector to be visible. Using the IsExpanded property of the node we can able to find whether the node is expanded or collapsed so that we can able to set the visibility of the connector to false When it gets expanded. We have added a code snippet for your reference.
Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/expandandcollapsevisibility1939541069
| |
|
An exception occurs when expanding the node. |
Reported Issue: unable to cast exception occurs when clicking on the expand icon
We can reproduce the issue and confirm this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on the 7th December 2021 weekly patch release.
|
Thanks I can confirm that your snippet works on my projet !
I'll mark that ticket as resolved and will wait for the patch in December.
Regards,
--Nicolas
No problems,
--Nicolas
Hi Nicolas,
We are glad to announce that our Essential Studio 2021 Volume 4 release v19.4.0.38 is rolled out and is available for download under the following link.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Sarath
Thanks, it does appear that the exception is not thrown anymore, but I still need the snippet to reset the visibility to false am I right ?
Anyway that's not too much of a big deal.
I'll consider that issue resolved