Connector property hidden not assed after using colapse and expand

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:

step_1_hide_connectors.png

So exactly what it is supposed to look like


Then I collapse the elementsstep_2_collapse_node.png


Then I expand the nodes :
step_3_connectors_shown.png

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


10 Replies 1 reply marked as answer

SS Sivakumar Sekar Syncfusion Team November 16, 2021 02:05 PM UTC

Hi Nicolas, 

We are validating your requirements and update you with more details on November 18th, 2021. 

Regards, 
Sivakumar 



SS Sivakumar Sekar Syncfusion Team November 18, 2021 03:54 PM UTC

Hi Nicolas, 

Please refer to the response to your query in the below table. 

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. 

public void Clicked(IBlazorClickEventArgs args) 
   
        if(args.Element.Selector != null && args.Element.Selector.Nodes[0].IsExpanded) 
       
            for(int i =0;i< Diagram.Connectors.Count;i++) 
       
            Diagram.Connectors[i].Visible = false; 
       
        }; 
   














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.    
     


Regards, 
Sivakumar      



NN Nicolas Navier November 18, 2021 04:50 PM UTC

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

 


Marked as answer

SS Sivakumar Sekar Syncfusion Team November 19, 2021 02:20 PM UTC

 
Most Welcome. Thanks for your update.  
 
Regards, 
Sivakumar  


AR Aravind Ravi Syncfusion Team December 8, 2021 01:39 PM UTC

Hi Nicolas,

We deeply regret for the inconvenience caused. We have fixed the reported issue, due to some technical reasons, we are unable to include the fix for the issue in this weekly patch release. We will include the fix for this issue in our volume 4 2020 main release which is scheduled to release at mid of December. We appreciate your patience until then.

https://www.syncfusion.com/feedback/30495/unable-to-cast-exception-occurs-when-clicking-on-the-expand-icon  

Regards 
Aravind Ravi


NN Nicolas Navier December 8, 2021 02:02 PM UTC

No problems,


--Nicolas



AR Aravind Ravi Syncfusion Team December 9, 2021 12:02 PM UTC

Hi Nicolas, 
Thanks for the update. As said earlier, We will include the fix for this issue in our volume 4 2020 main release which is scheduled to release at mid of December. We appreciate your patience until then.

https://www.syncfusion.com/feedback/30495/unable-to-cast-exception-occurs-when-clicking-on-the-expand-icon   
Regards 
Aravind Ravi 



SV Sarathkumar V Syncfusion Team December 20, 2021 02:22 PM UTC

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.


https://www.syncfusion.com/forums/171304/essential-studio-2021-volume-4-main-release-v19-4-0-38-is-available-for-download


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



NN Nicolas Navier January 7, 2022 09:05 PM UTC

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



AR Aravind Ravi Syncfusion Team January 10, 2022 09:26 AM UTC

Hi Nicolas. 

Thanks for your update. 

Regards 
Aravind Ravi 


Loader.
Up arrow icon