Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
cell autosize
posted

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.....

         

        
 

 

 

Parents Reply
  • 595
    posted in reply to Mike Saltzman

    Mike, you are correct, that code did not quite make sense so I modified it to something like this:

    That did the trick with auto-sizing so that cell text shows completely. Is there any way to make sure the columns band occupies the entire visible area of the control though (width) - there's still some space between the right edge of the hosting control and the right-most column.

    Also, code above auto-sizes child band columns. What is a good place to make sure top band columns are auto-sized once the grid appears? I tried forcing Columnset.Columns to PerformAutoResize within tree_ColumnSetGenerated() handler but no sizing is done.

    Thanks.

Children