Hi all i'm using a ultratreeview with viewstyle = freeform , i need to show large text in a column cell, i want the cell is fixed witdh and autosize height, this is my code but the cell don't size automatically:
UltraTreeColumnSet columnSet = new UltraTreeColumnSet(); UltraTreeNodeColumn info = columnSet.Columns.Add("info"); info.Text = "Descrizione"; info.CellWrapText = Infragistics.Win.DefaultableBoolean.True; info.AutoSizeMode = ColumnAutoSizeMode.VisibleNodes; info.LayoutInfo.PreferredLabelSize = new System.Drawing.Size(80, 20); info.LayoutInfo.PreferredCellSize= new System.Drawing.Size(80, 50); info.DataType=typeof(string); utvScadenze.NodeLevelOverrides[3].ColumnSet=columnSet;
...... Laod Tree.....
Hello,
Could you please try the following two lines in order to achieve the desired behavior:
info.ColumnSet.CellWrapText = Infragistics.Win.DefaultableBoolean.True; info.ColumnSet.ColumnAutoSizeMode = ColumnAutoSizeMode.AllNodes;
Please feel free to let me know if I misunderstood you or if you have any other questions.
Not to hijack this thread but I have a related question. My ViewStyle=Grid, I am performing auto sizing each column on expansion by doing something like this in tree_AfterExpand()
foreach (UltraTreeNodeCell cell in parent.Cells)
{ cell.Column.PerformAutoResize(
Infragistics.Win.UltraWinTree.ColumnAutoSizeMode.VisibleNodes);}
however when the grid shows I see that the tree 'grid' does not occupy the entire width of the hosting control and it does not appear as though each cell expanded wide enough to display the text inside (whilst there's plenty of space left). Is there anything else I should do? Thanks.