Provides a hierarchic view over an IGraph.

Namespace: yWorks.yFiles.UI.Model
Assembly: yWorks.yFilesSilverlight.Viewer (in yWorks.yFilesSilverlight.Viewer.dll) Version:


public interface IGroupedGraph
Visual Basic
Public Interface IGroupedGraph


The Nodes in a graph can be put into a hierarchical relationship. This interface provides access to the Hierarchy of the nodes and offers methods to modify the graph's node hierarchy. An implementation of this interface can be queried from DefaultGraph's Lookup(Type) method, if GroupingSupported is set to trueTruetruetrue (True in Visual Basic).


IGraph graph = GraphControl.Graph;

// Turn on grouping support in DefaultGraph.
DefaultGraph defaultGraph = graph.Get<DefaultGraph>();
if (defaultGraph != null) {
  defaultGraph.GroupingSupported = true;

// Use the grouping support.
IGroupedGraph grouped = graph.GetGroupedGraph();
if (grouped != null) {
  grouped.GroupNodeDefaults.Style = new ShapeNodeStyle(ShapeNodeShape.RoundRectangle, Pens.Aquamarine, null);
  INode groupNode = grouped.CreateGroupNode();
  grouped.GroupNodes(groupNode, new INode[] { node1, node2, node3 });

See Also