private void BindTrvwBudget() { this.trvwBudget.Nodes.Clear(); string value = this.hdnProjectCode.Value; if (!string.IsNullOrEmpty(value)) { IList <BudTask> firstLayerList = BudTask.GetFirstLayerList(value); foreach (BudTask current in firstLayerList) { TreeNode treeNode = new TreeNode(current.Name, current.Id); IList <BudTask> listByParentId = BudTask.GetListByParentId(treeNode.Value); if (listByParentId.Count > 0) { this.AddChildToTrvwBudget(treeNode, listByParentId); } this.trvwBudget.Nodes.Add(treeNode); } this.trvwBudget.ExpandAll(); } }