I use UltraTree 2009.1 and Tree in ViewStyle=Standard
The tree is bound to a datatable ans all nodes are shown fine. In some cases I need to resort my tree. For this reason I have a sort comparer class setting up like this:
Never is sorted and the Compare member of my comparer class is never be called. Thanks for any help.
Markus
Try setting the SortComparer property on the Column instead. If you set the ColumnSet's NodeTextColumn property, use that column, otherwise it will just be the first column in the ColumnSet.
In the standard .NET TreeView there is a TreeViewNodeSorter that can be replaced by a custom NodeSorter which derives from IComparer. This allows to sort the tree based upon information in the TreeNodeTag, for instance.
I am using an UltraTree in Outlook style (multicolumn), and I want to sort the tree using the TreeNodeTag. So I am trying to use the UltraTree.Override.SortComparer and the RefreshSort method to trigger, but it does not work...
What should I do ?
I have now set the comparer to that column, doen't work either. My code looks like this:
private void OrgTree_ColumnSetGenerated( object sender, Infragistics.Win.UltraWinTree.ColumnSetGeneratedEventArgse ) {
e.ColumnSet.NodeTextColumn = e.ColumnSet.Columns[
"FullName"];
e.ColumnSet.NodeTextColumn.SortComparer = new OrgTreeComparer( ... );
After the Property Dialog of a tree node I update the treenode.tag-object and try to refresh the node.text and resort the tree.
node.Text = (MyTagClass)tag.FullName;
tree.RefreshSort( node.Parent.Nodes, false);
My comparer is still not called and the tree node text is not changed either. My property dialog, however, is not bound to the same datatable. So I have to change the node.text manually. Any other ideas what I'm doing wrong?
Thanks, Markus