Why move
Existing Infragistics subscriptions can still be renewed, and Ultimate UI for Windows Forms is still being released. What changed is how you get a new license: a new developer on the team, or a new project, now needs a suite license, even when the application uses only a few Windows Forms controls. If those controls are a tree, a multi-column dropdown, masked and date fields and tabs, our five .NET controls cover them, sold separately or together. See moving from Infragistics Windows Forms for all five.
What you get
SftTree/NET 3.0 is a tree control for Windows Forms, written entirely in C# and shipped as a single assembly.
- Columns that work at every level. Column headers, column footers and row headers with row or outline numbers, columns the user can resize and reorder, and a splitter with two panes that scroll on their own, so the first columns stay in view in a wide tree.
- Anything in a cell. Text, images, buttons, dropdown buttons, check boxes, radio buttons and progress bars, in any cell, header or footer, and cells merged with their neighbors when the contents match.
- Check boxes in multi-column trees. A check box goes into any column of any item. UltraTree's check box node styles apply to its Standard view only.
- Selection the way users expect it. Items across different parents without extra settings, or single cells, several cells or a block of cells.
- Drag and drop with less code. The control finds the drop target while the user drags, and expands and scrolls the tree as the mouse hovers.
- Data binding to plain lists. A flat list becomes a tree through a key and a parent member, or nested lists through a children member, and the selected item follows the current row.
- Modern Windows. The same API and Visual Studio designer support in .NET Framework 4.7 (or later) and .NET 10 (or later) applications. The tree follows the Windows dark mode setting automatically, scales with the DPI of the monitor showing it, honors the Windows contrast themes and has built-in UI Automation support for Narrator, NVDA, JAWS and other screen readers.
A license is per developer and royalty-free, sold on its own.
Member mapping
SftTree/NET is not a drop-in replacement: there are no Appearance or Override objects and no view styles, columns are addressed by index, and nodes are called items. Many names will still look familiar. This table shows where each UltraTree member is found.
| Task | UltraTree | SftTree/NET 3.0 |
|---|---|---|
| Adding nodes | Nodes.Add, UltraTreeNode.Nodes.Add | SftTree.ItemCollection.Add, ItemClass.Add, with a text or one text per column |
| Inserting nodes | Nodes.Insert | ItemClass.InsertBefore, InsertAfter, InsertFirst, InsertLast |
| Removing nodes | UltraTreeNode.Remove, Nodes.Clear | ItemClass.Remove, ItemClass.RemoveChildren, ItemCollectionClass.Clear |
| Navigating | Parent, Nodes, Level, RootNode, HasNodes, NextVisibleNode, PrevVisibleNode | ItemClass.Parent, Children, Level, TopParent, HasChildren, NextVisible, PreviousVisible, NextSibling, PrevSibling |
| Moving and copying | UltraTreeNode.Reposition, Clone | ItemClass.Move, ItemClass.Copy |
| Keys and tags | Key, GetNodeByKey, Tag | ItemClass.TagString with SftTree.FindItemTagString, ItemClass.TagObject |
| Batch updates | BeginUpdate, EndUpdate | SftTree.Initializing |
| Columns | ViewStyle OutlookExpress, ColumnSettings.RootColumnSet.Columns | SftTree.Columns.Count; one set of columns for all levels |
| Column headers | UltraTreeNodeColumn.Text | SftTree.Headers[row, column].Text |
| Cell values | SetCellValue, GetCellValue, GetCellText, Cells | ItemClass.Cells[column].Text |
| Hierarchy column | CanShowExpansionIndicator, ExpansionIndicatorColumn | ColumnClass.ShowHierarchy |
| Column sizing and moving | PerformAutoResize, AutoSizeMode, AllowMoving, AfterColumnMoved | ColumnClass.Width, ColumnClass.MakeOptimal, ColumnClass.Reorderable, SftTree.ColumnReordered |
| Selection style | Override.SelectionType, SelectionBehavior | SftTree.SelectionStyle (SingleItem, MultipleItems, SingleCell, MultipleCells, BlockOfCells) |
| Selected nodes | UltraTreeNode.Selected, SelectedNodes | ItemClass.Selected, SftTree.SelectedItem, SftTree.SelectedObjects, SftTree.SelectRange |
| Active node | ActiveNode, ActiveCell | SftTree.FocusItem, SftTree.FocusCell |
| Selection events | BeforeSelect, AfterSelect, AfterActivate | SftTree.SelectionChanged, SftTree.FocusObjectChanged |
| Check boxes | Override.NodeStyle (CheckBox, CheckBoxTriState, OptionButton), CheckedState | A CheckBoxPartClass or RadioButtonPartClass in any cell, CheckBoxPartClass.State |
| Check events | BeforeCheck, AfterCheck | SftTree.CheckBoxClicked, SftTree.RadioButtonClicked |
| Expanding | Expanded, Toggle, ExpandAll, CollapseAll | ItemClass.Expand and ItemClass.Collapse, for one level or all, and ItemClass.Expanded |
| Expand events | BeforeExpand, AfterExpand, BeforeCollapse, AfterCollapse | SftTree.ItemExpanded, SftTree.ItemCollapsed |
| Loading on demand | ShowExpansionIndicator CheckOnExpand, BeforeExpand | ItemClass.ExpandCollapseButton, and SftTree.ItemClick with SftTree.AutoRespond turned off |
| Editing | LabelEdit, BeginEdit, BeforeLabelEdit, ValidateLabelEdit, AfterLabelEdit | CellClass.Edit, SftTree.EditAllowed, SftTree.EditSetup, SftTree.EditValidate, SftTree.EditEnded |
| Images | ImageList, NodeAppearance.Image, LeftImages, RightImages | ItemClass.Image, SftTree.ItemLeafImage, SftTree.ItemExpandableImage, SftTree.ItemExpandedImage, CellBaseClass.Image, and image parts for more |
| Colors | NodeAppearance, SelectedNodeAppearance, CellAppearance, HeaderAppearance, NodeLevelOverrides | SftTree.BackColor, SftTree.BackColorOdd, SftTree.BackColorSelected, ColumnClass.BackColor, ItemClass.BackColor, CellBaseClass.BackColor and BackColorEnd for gradients |
| Lines and hot tracking | ShowLines, NodeConnectorStyle, NodeConnectorColor, Indent, HotTracking | SftTree.TreeLineStyle, SftTree.TreeLineColor, SftTree.Dimensions.LevelIndent, SftTree.FlybyHighlight |
| Data binding | DataSource, DataMember, SetDataBinding, AutoGenerateColumnSets | SftTree.DataSource, SftTree.DataMember, ColumnClass.DataMember, and SftTree.DataKeyMember with SftTree.DataParentMember, or SftTree.DataChildrenMember, for the hierarchy |
| Per-node setup | InitializeDataNode, ListObject | SftTree.ItemDataBound, ItemClass.DataItem |
| Sorting | Override.Sort, SortComparer, RefreshSort | ItemCollectionClass.Sort by any column, ascending or descending, CellBaseClass.SortStatus for the indicator, SftTree.HeaderClicked |
| Drag and drop | SelectionDragStart, AllowAutoDragScrolling, AutoDragExpandDelay | SftTree.DragStyle, SftTree.DragDetected, SftTree.DropTarget, SftTree.AutoExpandDragDrop, SftTree.DragDropHoverInterval |
| Hit testing | GetNodeFromPoint, UltraTreeNode.Bounds | SftTree.ItemFromPoint, SftTree.CellFromPoint, SftTree.ColumnFromPoint, SftTree.GetDimension |
| Scrolling | TopNode, BringIntoView | SftTree.TopItem, ItemClass.ScrollIntoView |
| Saving the tree | SaveAsXml, LoadFromXml | SftTree.GetContents, SftTree.SetContents |
The same tree in both
Both examples build a tree with a Name and a Size column, add a parent with two children, expand it and show the selected item's size. With UltraTree:
ultraTree1.ViewStyle = ViewStyle.OutlookExpress;
UltraTreeColumnSet columnSet = ultraTree1.ColumnSettings.RootColumnSet;
nameColumn = columnSet.Columns.Add("Name");
nameColumn.Text = "Name";
sizeColumn = columnSet.Columns.Add("Size");
sizeColumn.Text = "Size";
sizeColumn.CanShowExpansionIndicator = DefaultableBoolean.False;
UltraTreeNode parent = ultraTree1.Nodes.Add("parent", "Parent");
parent.SetCellValue(nameColumn, "Parent");
parent.SetCellValue(sizeColumn, "12 KB");
UltraTreeNode child = parent.Nodes.Add("child1", "Child 1");
child.SetCellValue(nameColumn, "Child 1");
child.SetCellValue(sizeColumn, "4 KB");
child = parent.Nodes.Add("child2", "Child 2");
child.SetCellValue(nameColumn, "Child 2");
child.SetCellValue(sizeColumn, "8 KB");
parent.Expanded = true;
ultraTree1.AfterSelect += ultraTree1_AfterSelect;
private void ultraTree1_AfterSelect(object sender, SelectEventArgs e) {
if (e.NewSelections.Count == 0) return;
labelInfo.Text = "Size: " + e.NewSelections[0].GetCellText(sizeColumn);
}
With SftTree/NET, an item's cells are filled from one string per column:
sftTree1.Initializing = true;
sftTree1.Columns.Count = 2;
sftTree1.Headers[0, 0].Text = "Name";
sftTree1.Headers[0, 1].Text = "Size";
ItemClass parent = sftTree1.ItemCollection.Add(new string[] { "Parent", "12 KB" });
parent.Add(new string[] { "Child 1", "4 KB" });
parent.Add(new string[] { "Child 2", "8 KB" });
parent.Expand(ExpandStyleEnum.Simple);
sftTree1.Initializing = false;
sftTree1.SelectionChanged += sftTree1_SelectionChanged;
private void sftTree1_SelectionChanged(object sender, EventArgs e) {
ItemClass item = sftTree1.SelectedItem;
if (item == null) return;
labelInfo.Text = "Size: " + item.Cells[1].Text;
}
You can also skip most of this code: columns, headers and their appearance are set up in the Visual Studio designer.
Migration notes
- Add with one string sets the text. UltraTree's Nodes.Add with one string sets the node's key; SftTree/NET's sets the text of the first cell. To find items by a key, store it in TagString and use FindItemTagString.
- One set of columns. The columns and headers apply to every level, as in UltraTree's OutlookExpress view. Cells hold text; bound columns are formatted with ColumnClass.DataFormat.
- Loading on demand goes through ItemClick. Show the expand button with ItemClass.ExpandCollapseButton, turn off SftTree.AutoRespond and add the children when the button is clicked. ItemExpanded, SelectionChanged and CheckBoxClicked report a change once it is made.
- Editing uses a control you choose. CellClass.Edit starts editing, EditSetup hands over the edit control, such as a TextBox or a ComboBox, and EditEnded saves the value.
- Visible means its parents are expanded. Setting ItemClass.Visible expands the item's parents.
Before you start
Check three things in your forms: SftTree/NET has no built-in editor, so in-place editing needs the edit control of your choice; a bound tree shows the data but does not write cell edits back to the data source; and a tree that uses UltraTree's Grid or FreeForm view, with different columns per level, gets one set of columns for all levels.
Try it
The free trial includes the working control and the C# and VB.NET samples. Replace one UltraTree in your own forms before you buy. A license is per developer, royalty-free, and includes one year of support and upgrades.
Infragistics and UltraTree are trademarks of Infragistics, Inc. Softel vdm is not affiliated with Infragistics.
