Hi,
I have a requirement to sort only nodes at level 1. Actually the tree has nodes up to 3 levels. I am setting the UltraTree.NodeLevelOverrides[1].Sort = SortType.Ascending. But after clicking on the column header, when all the nodes are in collapsed state, 0 level nodes are sorted. After expanding root nodes (0 level nodes), if we click on the header, root nodes are not sorted but first level nodes and second level nodes are sorted. Is there any other property i need to set in addition to nodeleveloverride.
Sriram Sarma.
Hi Sriram,
I'm afraid I do not understand your question. Is this somehow related to the other posts in this thread regarding sorting? Or are you asking something completely unrelated?
The code you have here for SetCellValue doesn't make a lot of sense to me. You are only showing the code for one cell - this code isn't looping through all the cell. And I don't see why you would be using the NodeLevelOverrides to set a value on a cell.
Hi Mike,
I am bing the node recursively to the tree in OutLookExpress mode. First i am taking a column collection from the user and creating a columnset with that (treeColumnSet). Later while adding the nodes collection to the tree i am doing like this:
UltraTreeColumnSet columnSet = new UltraTreeColumnSet();
m_ultraTreeNode = node.Nodes.Add(); m_ultraTree.NodeLevelOverrides[m_ultraTreeNode.Level].ColumnSet = columnSet; foreach ( UltraTreeNodeColumn column in treeColumnSet.Columns ) { columnSet.Columns.Add(column); } columnSet.Key = "Level" + m_ultraTreeNode.Level.ToString(); columnSet.AllowSorting = Infragistics.Win.DefaultableBoolean.False; m_ultraTree.ColumnSettings.ColumnSets.Add(columnSet);
And i am adding the cell text like this:
m_ultraTreeNode.SetCellValue(m_ultraTreeNode.NodeLevelOverrides[m_ultraTreeNode.Level].ColumnSet.Columns[item.ColumnIndex], item.CellText);
I am trying to add three level nodes to my tree. After doing like this, only the last level nodes are having cell text.
Image is as follows:
I understood that only the last columnset values are stored but not the previous ones. But unable to fix this.
Can you check where i have made the mistake.
Thanks & regards,
Sriram.
Set the property on the ColumnSet that applies to the level you want.
Typically, each level of data will be using a different ColumnSet - unless you are using a recursive data source and every level has the same structure. In that case, you will need to create a new ColumnSet and assign it to the levels that you want to be different from the others.
Thank you for the reply. By using AllowSorting property on ColumnSet, how can i sort only particular level nodes.
Regards,
Sarma.
The sort property on the NodeLevelOverrides is only use when sorting nodes that are in Standard ViewStyle. When you are using a style that has columns, the column sorting is used.
So you need to use the AllowSorting property on the ColumnSet. If your tree is bound and you are allowing the tree to generate the ColumnSets automatically, then the ColumnSetGenerated event is probably a good place to do this.