private void Fillrootnode(List <SPMConnectAPI.ReleaseItem> releaseItems) { try { treeView1.Nodes.Clear(); RemoveChildNodes(root); treeView1.ResetText(); SPMConnectAPI.ReleaseItem sa = releaseItems.Find(i => i.ItemNumber == rlog.SubAssy); root.Text = sa.AssyNo + " - " + sa.AssyDescription; root.Name = sa.AssyNo; root.Tag = sa.AssyNo + "][" + sa.AssyDescription + "][" + sa.AssyFamily + "][" + sa.AssyManufacturer + "][" + sa.AssyManufacturerItemNumber + "][1"; Setimageaccordingtofamily(sa.AssyFamily, root); treeView1.Nodes.Add(root); //var itemToRemove = releaseItems.SingleOrDefault(r => r.ItemNumber == satxt.Text.Trim()); //if (itemToRemove != null) // releaseItems.Remove(itemToRemove); PopulateTreeView(releaseItems, root); } catch { treeView1.TopNode.Nodes.Clear(); treeView1.Nodes.Clear(); RemoveChildNodes(root); treeView1.ResetText(); } }
private void TreeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (publicnode != null) { publicnode.BackColor = treeView1.BackColor; publicnode.ForeColor = treeView1.ForeColor; } SPMConnectAPI.ReleaseItem sa = rlog.ReleaseItems.Find(i => i.ItemNumber == treeView1.SelectedNode.Name); if (sa != null) { itemnolbl.Text = "Item No : " + sa.ItemNumber; itmdeslbl.Text = "Description : " + sa.Description; itmoemlbl.Text = "Manufacturer : " + sa.Manufacturer; itemoemitmlbl.Text = "OEM Item No : " + sa.ManufacturerItemNumber; Filllistview(sa.ItemNumber); } }