I have one List type of my own struct.This is my struct.
public struct outlineData
{
public string paragraphID;
public string outlineText;
public int outlineLevel;
}
and my List is
List<outlineData> outlinePara = new List<outlineData>();
So, i have added so many outlineData in my outlinePara List.Now, i want to create a TreeView based on the outlineData's outlineLevel.
for example : outlineData's outlineLevel may be 0,1,2,3,1,2....0,1...0,1,1,1,1,1,2,3,2....
So, Now i want to create a Treeview like that...
0
1
2
3
1
2
0
1
0
1
1
1
1
1
2
3
2
TreeNode childNode;
if (outlineParaInfo.outlineLevel == 0)
{
headNode = new TreeNode(outlineParaInfo.outlineText);
TreeView11.Nodes.Add(headNode);
}
else if (outlineParaInfo.outlineLevel == 1)
{
childNode = new TreeNode(outlineParaInfo.outlineText);
headNode.ChildNodes.Add(childNode);
}
Please guide me to get a correct logic for this problem...