Exemplo n.º 1
0
 /// <summary>
 /// 删除节点
 /// </summary>
 internal bool DeleteNode(TreeGridNodeCollection nodes, int id)
 {
     for (int i = 0; i < nodes.Count; i++)
     {
         if (nodes[i].Cells[IdColumn()].Value.ToInt() == id)
         {
             nodes.RemoveAt(i);
             return(true);
         }
         if (nodes[i].IsExpanded && nodes[i].Nodes.Count > 0)
         {
             if (DeleteNode(nodes[i].Nodes, id))
             {
                 return(true);
             }
         }
     }
     return(false);
 }