I wrote a code for this a month ago but now I do not remember it correctly. However, I'll try to explain ;) All you need a funtion and a generic list to hold all these values. eg.
public class ValuesHolder
{
public int ID;
public int ParentID;
public string Text;
public ValuesHolde(int id, int parentID, string text)
{
// set values here
}
}
List<valuesholder> ValuesHolder_List = new List<valuesholder>();
ValuesHolder_List.Add(new ValuesHolde(id, parentID, text)); // an example
for (int a = 0; a < ValuesHolder_List.Count; a++)
{
if (ValuesHolder_List[a].ParentID == 0)
{
TV.Nodes.Add(ValuesHolder_List[a].ID, ValuesHolder_List[a].Text);
ValuesHolder_List.RemoveAt(a--); // delete that item as well as a step back
}
}
while (ValuesHolder_List.Count != 0)
{
for (int a = 0; a < ValuesHolder_List.Count; a++)
{
TreeNode[] tns = TV.Nodes.Find(ValuesHolder_List[a].ParentID, true);
if (tns.Length > 0)
{
tns[0].Nodes.Add(ValuesHolder_List[a].ID, ValuesHolder_List[a].Text);
ValuesHolder_List.RemoveAt(a--); // delete that item as well as a step back
}
}
}
I didn't test the code, but I'm sure it'll help you.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can