Extended TreeView Tutorials

Node formating

Extended TreeView supports table formating in the node. You can embed any content inside a node, including checkboxes, images, buttons.

Node table structure

Each node has two properties for table formating. NormalTable property for normal state or SelectedTable for selected state. Table has columns and rows. For each column you can crete ColumnStyle, where you can specify SizeTypes (Absolute, Percent or AutoSize) and column width. Table consists of cells. For one cell you can assign only one node object.
ExtendedTreeNode tNode = new ExtendedTreeNode(); tNode.NormalTable.Objects.Clear(); tNode.NormalTable.ColumnStyles.Clear(); tNode.NormalTable.ColumnStyles.Add( new AltaVim.WinForms.ColumnStyle(SizeTypes.Absolute, 100f) ); tNode.NormalTable.ColumnStyles.Add( new AltaVim.WinForms.ColumnStyle(SizeTypes.Percent, 30f) ); tNode.NormalTable.RowCount = 4; tNode.NormalTable.ColumnCount = 3; tNode.NormalTable.DefaultCell.HorizontalAlignment = AltaVim.WinForms.HorizontalAlignment.Left; tNode.NormalTable.DefaultCell.VerticalAlignment = VerticalAlignment.Middle; tNode.NormalTable.Objects.Add( new TextNodeObject( "Cell 0,0 with RowSpan = 3 You can format any node with flexible table layout" ), 0, 0); tNode.NormalTable.SetRowSpan(tNode.NormalTable.Objects[0], 3); tNode.NormalTable.Objects.Add(new TextNodeObject("Cell 1,0 with ColumnSpan = 2"), 1, 0); tNode.NormalTable.SetColumnSpan(tNode.NormalTable.Objects[1], 2); tNode.NormalTable.Objects.Add(new TextNodeObject("Cell 1,1"), 1, 1); tNode.NormalTable.Objects.Add(new TextNodeObject("Cell 2,1"), 2, 1); TextNodeObject obj = new TextNodeObject("Cell 1,2"); tNode.NormalTable.Objects.Add(obj, 1, 2); tNode.NormalTable.SetColumnSpan(obj, 2); tNode.NormalTable.SetRowSpan(obj, 2); tNode.NormalTable.Objects.Add(new TextNodeObject("Cell 0,3"), 0, 3); tNode.SelectedTable = tNode.NormalTable; extendedTreeView1.Nodes.Insert(1, tNode);