J'ai un TreeView sur ma principale formeComment ajouter un nœud enfant à un nœud enfant dynamiquement ajouté
J'ai mon code d'un de la forme principale est comme suit
Buttonclick
StrNode = string.Empty;
StrNode = "Batch" + Append.Batchcnt.ToString() + "(" + strSelectedClassCode + ")";
frmmain.loadFromForm(StrNode, true, strSelectedClassCode);
Sur mon principale forme que j'ai mon code comme suit
public void loadFromForm(string strNode, bool bResult, string strStandardClsCode)
{
if (Append.oldbatchcontrol != strNode)
{
if (tvwACH.SelectedNode.Text == "FileHeader")
{
tvwACH.SelectedNode.Nodes.Add(strNode);
}
if (tvwACH.SelectedNode.Text == "BatchHeader")
{
tvwACH.SelectedNode.Nodes.Add(strNode);// After this i have to add another node as a child to that added node and also if a node with particular name exists i would like to write the text with a count value appended
}
}
}
Alors que mon TreeView devrait être comme suit
ACH
|->Some.txt
|->Fileheader
|->BatchHeader
|->Batch1
|->Entry1
|->Entry2 and so on // These two should be added dynamically after that Batch1
Ok, mais comment puis-je vérifier et ajouter le cnt si le nœud existe – Dotnet
Merci pour l'idée que j'ai eu selon mon exigence – Dotnet