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
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.
UltraTree uses the layout manager support that is built into the Infragistics framework; admittedly, some have found this to be difficult to use although it does offer a great deal of flexibility. UltraGrid's VisiblePosition property predates the layout manager support that was added to UltraGrid since its original release, but since UltraTree only uses the layout manager support, the VisiblePosition property (and Width property, on a related note) were not added.
The reason the OriginX property is not set is because by default, the ordinal position of the column within its Columns collection is used. What you can do to change this is handle the ColumnSetGenerated event, which gives you the UltraTreeColumnSet being generated, and explicitly set the UltraTreeNodeColumn.LayoutInfo.OriginX property on each member of the Columns collection; this is the equivalent of setting the VisiblePosition property of an UltraGridColumn. Note that the UltraTreeNodeColumn.LayoutInfo equivalent of the Width property is PreferredLabelSize.Width (or PreferredCellSize.Width if headers are not being displayed).
How can we reoder the column of a columnset, so that to add an unbounded column at the begining of the row of columns.
I have checked the OriginX property does not provide correct information for columns (order, position) at the time of columnset generated or initalize data node events.
Please suggest how can we acheive it.
regardsVivek Bahl
I suggest trying the Column.LayoutInfo.OriginX property. This is related to SpanX property.
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.