private void ChangeProperty(GridTreeNode ParentNod, string value, CurrentCellValidatingEventArgs e)
 {
     foreach (GridTreeNode nod in ParentNod.ChildNodes)
     {
         object mnu = nod.Item;
         mnu.GetType().GetProperty(ComboProperty).SetValue(mnu, value);
         this.AssociatedObject.InternalGrid.InvalidateCell(e.Style.CellRowColumnIndex);
         if (nod.HasChildNodes == true)
         {
             ChangeProperty(nod, value, e);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Accessor
        /// </summary>
        /// <param name="allBranches"></param>
        public GridTopology(List<BranchDto> allBranches, List<NodeDto> allNodes)
        {
            if (this.allBranches == null || this.allNodes == null)
            {
                this.allBranches = allBranches;
                this.allNodes = allNodes;

                nodes = new GridTreeNode<string>[allNodes.Count];
                gridNodeTopologyObject = new GridTreeNode<string>[allNodes.Count];
                GetRootBranch();
                GetRootNode();
                nodeCurrentId = _rootNodeId;
                CreateTopologyDescriptionObject();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Populates the specified g.
        /// </summary>
        /// <param name="g">The g.</param>
        /// <param name="e">The e.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="level">The level.</param>
        /// <param name="parentNode">The parent node.</param>
        /// <returns></returns>
        private static GridTreeNode Populate(GridTreeControl g, EmployeeInfo e, EmployeeInfo parent, int level, GridTreeNode parentNode)
        {
            GridTreeNode node = new GridTreeNode(level, e, true, parentNode);

            g.InternalGrid.Nodes.Add(node);
            node.ParentItem = parent;
            IEnumerable <EmployeeInfo> childNodes = viewModel.GetReportees(e.ID);
            bool hasChildren = false;

            foreach (EmployeeInfo e1 in childNodes)
            {
                Populate(g, e1, e, level + 1, node);
                hasChildren = true;
            }
            node.HasChildNodes = hasChildren;
            return(null);
        }