Hi
The first time the tree is printed this is what the tree looks like:
-Administration
- Database
- Documents
- Users
And after reload the tree looks like this:
-Administration
- Database
- Documents
- Users
- Database
- Documents
- Users
Here is a sample of the code:
protected void MainTree_OnPopulateNodes(object sender, FlyTreeNodeEventArgs e)
{
DataSet ds = null;
switch (e.Node.Level)
{
case 0:
if (String.Equals(e.Node.Text, PLATFORMS, StringComparison.OrdinalIgnoreCase))
{
ds = DatabaseFunctions.TreeGetPlatforms();
Level1_PlatformNodes(ds, e.Node.ChildNodes);
}
else
{
Level1_AdministrationNodes(e.Node.ChildNodes);
}
break;
case 1:
if (String.Equals(e.Node.Text, ADMINISTRATION_USERS, StringComparison.OrdinalIgnoreCase))
{
Level2_AdministrationUserNodes(e.Node.ChildNodes, e.Node);
}
else if (String.Equals(e.Node.Text, ADMINISTRATION_DOCUMENTS, StringComparison.OrdinalIgnoreCase))
{
Level2_AdministrationDocumentNodes(e.Node.ChildNodes, e.Node);
}
else if (String.Equals(e.Node.Text, ADMINISTRATION_DATABASE, StringComparison.OrdinalIgnoreCase))
{
Level2_AdministrationDatabaseNodes(e.Node.ChildNodes, e.Node);
}
break;
}
}
private void Level1_AdministrationNodes(FlyTreeNodeCollection nodes)
{
FlyTreeNode ftn = CreateNode(
ADMINISTRATION_DATABASE,
"A",
ADMINISTRATION_DATABASE,
null,
null,
null,
true,
false,
false
);
nodes.Add(ftn);
ftn = CreateNode(
ADMINISTRATION_DOCUMENTS,
"B",
ADMINISTRATION_DOCUMENTS,
null,
null,
null,
true,
false,
false
);
nodes.Add(ftn);
ftn = CreateNode(
ADMINISTRATION_USERS,
"C",
ADMINISTRATION_USERS,
null,
null,
null,
true,
false,
false
);
nodes.Add(ftn);
}