How to hide connector nodes in document explorer

How can I hide connector nodes in the DocumentExplorer and how only closed nodes (in the nodes list)

In addition, I would like to hide Layers in the DocumentExplorer?

1 Reply

NG Naganathan Ganesh Babu Syncfusion Team March 26, 2018 09:17 AM UTC

Hi Allen, 
 
Thanks for contacting Syncfusion support. 
 
How can I hide connector nodes in the DocumentExplorer and how only closed nodes (in the nodes list) 
In System.Windows.Forms’s TreeView, we don’t have option to hide the node but we can delete the node from the TreeviewCollection. Please refer to the below link. 
  
 
So we suggest you to use Diagram.Model.EventSink “NodeCollectionChanged” event to delete the connector while adding the connector into model by using System.Windows.Forms.TreeView’s “Nodes” property. Please refer to the below code example. 
 
Code example: 
 
[VB] 
 
diagram1.Model.EventSink.NodeCollectionChanged += AddressOf EventSink_NodeCollectionChanged 
 
Private Sub EventSink_NodeCollectionChanged(ByVal evtArgs As CollectionExEventArgs) 
                  If evtArgs.ChangeType = CollectionExChangeType.Insert Then 
                        If TypeOf evtArgs.Element Is ConnectorBase Then 
                              'Removing layers tree from document explorer 
                              documentExplorer1.Nodes(0).Nodes(0).Nodes.RemoveAt(documentExplorer1.Nodes(0).Nodes(0).Nodes.Count - 1) 
                              documentExplorer1.Nodes(0).Nodes(0).Text ="Nodes" & "(" & (diagram1.Model.ChildCount - 1).ToString() & ")" 
                        End If 
                  End If 
End Sub 
 
 
In addition, I would like to hide Layers in the DocumentExplorer? 
We are facing some issues in our Diagram source while removing the Layers treeview from the DocumentExplorer. We will fix and remove the Layer tag in DocumentExplorer if the Model’s does not contains any layer.  so we have considered this as an issue with “Remove the Layer tag in document explorer if the layer’s count is zero” and the fix for issue available in our Volume 1 Service pack 2 release which is available on end of April 2018. 

Sample: 
 
 
Regards, 
 
Naganathan K G 


Loader.
Up arrow icon