Hi,
I have bound WinTree to a DataTable having multiple columns and I want to reorder the positioin of columns appearing in the Tree. The order of columns should be possible to change in the run time (not by user drag drop). I was looking for properties like VisibleHeaderPosition, but was unable to find. How to achieve this functionality? Please suggest.
Regards,
spm
Look under the properties panel of your ultraWinTree for ColumnSettings ->> ColumnSets ->>
From there, click the (...), and you should see the "UltraTreeColumnSet Collection Editor"
Select (from the left) the band of data you wish to modify the columns for. Then on the right, scroll down to the property called "Columns" and click on the (...).
Here you should see the "UltraTreeNodeColumn Collection Editor", and by using the up and down arrows, you should be able to change the order of the columns.
I understand you're looking for something which works in run-time; and i'm sure this is the head-start you were looking for.
regards,
-kel-
I have 2007 vol 2 clr 2.0
I tried the above and it leads me to a blank list. I created the treeview, clicked on Nodes and added my nodes there. I'm trying to change the order of the Nodes at design time, not run time and I seem to be missing how to do this. Any help would be great.
Hi Kel,
Thanks for your reply.
It is very strange that WinTree does not have VisiblePosition propery which is present in the UltraGrid and it is very useful funtionality. Since the index position of the column is what drives the display position, I thought perhaps Remove and InsertAt methods could be used to modify the index of the Column in the tree, but unfortunatley InsertAt method seems to be missing in the column collection object! (i.e., columnSet.Columns)
However there is round about approach to tackle this problem. In my scenario there is a datatable which contains information about how the columns in the tree should be positioned, in the sample code below the column formatting information is fetched in the ascending order of position column (which is the desired display order) and is looped through to reset the index.......
DataRow[ colCustomDetailRows = dataTable.Select("VisiblePosition ASC"); int position = 0; string columnName = string.Empty; UltraTreeNodeColumn nodeColumn = null; foreach (DataRow dataRow in colCustomDetailRows) { columnName = dataRow["ColumnName"].ToString(); nodeColumn = columnSet.Columns[; columnSet.Columns.Remove(nodeColumn);//remove the column from collection columnSet.Columns.Add(nodeColumn);//re-insert at the last position-once the looping is complete columns will be re-ordered correctly position++; }
Hope this will be helpful.