I have two datatables that are linked using relation of a dataset. I have been able to resize the parent columns to handle the longest value.
However I cannot get the child to auto expand to the longest child.
For Each col In UT1.Nodes(0).Cells col.Column.PerformAutoResize() Next
sets for the parent. but if I put
For Each col In UT1.Nodes(1).Cells col.Column.PerformAutoResize() Next
Nothing happens. Can anybody let me know how to get the child node columns to be as wide as longest value
Hello Tom,
Thank you for contacting Infragistics!
UT1.Nodes(0) is the first root node. And UT1.Nodes(1) is the second root node. So neither of these will do anything to child nodes. It is also not best practice to use the cells collection to get the column.
Either way if the tree is bound, it doesn’t load the child nodes until you expand the parent. So the best thing to do would be use the AfterExpanded event:
Private Sub UltraTree1_AfterExpand(sender As Object, e As NodeEventArgs) Handles UltraTree1.AfterExpand Dim columnSet = e.TreeNode.Nodes.ColumnSetResolved If (Not columnSet Is Nothing) Then For Each column As UltraTreeNodeColumn In columnSet.Columns column.PerformAutoResize(ColumnAutoSizeMode.AllNodesWithDescendants) Next End If End Sub
Thanks Michael. Appreciate your support and help