示例#1
0
 private void SelectAllFromStart(TreeNodeAdv node)
 {
     Tree.ClearSelection();
     int a = node.Row;
     int b = Tree.SelectionStart.Row;
     for (int i = Math.Min(a, b); i <= Math.Max(a, b); i++)
     {
         if (Tree.SelectionMode == TreeSelectionMode.Multi || Tree.RowMap[i].Parent == node.Parent)
             Tree.RowMap[i].IsSelected = true;
     }
 }
示例#2
0
 protected override void FocusRow(TreeNodeAdv node)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         if (Tree.SelectionMode == TreeSelectionMode.Single || Tree.SelectionStart == null)
             base.FocusRow(node);
         else if (CanSelect(node))
         {
             SelectAllFromStart(node);
             Tree.CurrentNode = node;
             Tree.ScrollTo(node);
         }
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
 public TreeViewAdvCancelEventArgs(TreeNodeAdv node)
     : base(node)
 {
 }
 protected virtual void FocusRow(TreeNodeAdv node)
 {
     Tree.SuspendSelectionEvent = true;
     try
     {
         Tree.ClearSelection();
         Tree.CurrentNode = node;
         Tree.SelectionStart = node;
         node.IsSelected = true;
         Tree.ScrollTo(node);
     }
     finally
     {
         Tree.SuspendSelectionEvent = false;
     }
 }
 protected bool CanSelect(TreeNodeAdv node)
 {
     if (Tree.SelectionMode == TreeSelectionMode.MultiSameParent)
     {
         return (Tree.SelectionStart == null || node.Parent == Tree.SelectionStart.Parent);
     }
     else
         return true;
 }
 public TreeViewAdvEventArgs(TreeNodeAdv node)
 {
     _node = node;
 }