Tree.AutoSizeColumn does not take the node.Level
Brought to you by:
agaman
The first column contains nodes which are usually indented depending on the node level.
The problem is that the TreeViewAdv.AutoSizeColumn() does not take the indent into account to compute the width of the first column.
It result into a wrong width for the first column and the node label text can appear as troncated.
From my part: the instruction res = Math.Max(res, w + node.Level); in the TreeViewAdv.AutoSizeColumn() function must be adapted.
I suggest this:
res = column.Index == 0 ? Math.Max(res, w + node.Level * _indent) : Math.Max(res, w + node.Level);
Since rev 72 in TreeViewAdv.Draw
I suggest this:
public void AutoSizeColumn(TreeColumn column)
...
TreeNodeAdv node = RowMap[row];
if (column.Index == 0)
{
w += (node.Level - 1) * _indent + LeftMargin;
if (ShowPlusMinus)
w += _plusMinus.GetActualSize(node, _measureContext).Width;
if (row == 0 && ShiftFirstNode)
w -= _indent;
}
foreach (NodeControl nc in NodeControls)
...