private void DrawLines(Graphics gr, TreeNodeAdv node, Rectangle rowRect)
{
if (UseColumns && Columns.Count > 0)
gr.SetClip(new Rectangle(0, rowRect.Y, Columns[0].Width, rowRect.Bottom));
TreeNodeAdv curNode = node;
while (curNode != _root && curNode != null)
{
int level = curNode.Level;
int x = (level - 1) * _indent + NodePlusMinus.ImageSize / 2 + LeftMargin;
int width = NodePlusMinus.Width - NodePlusMinus.ImageSize / 2;
int y = rowRect.Y;
int y2 = y + rowRect.Height;
if (curNode == node)
{
int midy = y + rowRect.Height / 2;
gr.DrawLine(_linePen, x, midy, x + width, midy);
if (curNode.NextNode == null)
y2 = y + rowRect.Height / 2;
}
if (node.Row == 0)
y = rowRect.Height / 2;
if (curNode.NextNode != null || curNode == node)
gr.DrawLine(_linePen, x, y, x, y2);
curNode = curNode.Parent;
}
gr.ResetClip();
}