Hello everybody!
I'm using a RadTreeView control and implemented LoadonDemand. Whenever a node gets expanded, or the page gets loaded for the first time, I load the childelements of the node too, to estimate whether to display the expand item or not.
This code gets called when i load the page for the first time (or refresh it):
Creating a node happens like that:
and expanding a node like that:
My Problems in short:
Whenever i refresh the page and expand the root items again, already deleted items are shown.
The node items are only shown in layer 1 and 2. Everything beneath these layers has no items.
After refreshing, the duplicate items are missing the images too.
I'm using a RadTreeView control and implemented LoadonDemand. Whenever a node gets expanded, or the page gets loaded for the first time, I load the childelements of the node too, to estimate whether to display the expand item or not.
This code gets called when i load the page for the first time (or refresh it):
| ParameterTreeView.Nodes.Clear(); |
| ICollection<IHierarchyElement> rootColl = treeStructureService.ParameterRootElements(); |
| foreach (IHierarchyElement element in rootColl) |
| { |
| RadTreeNode node = CreateNode(element); |
| ICollection<IHierarchyElement> childColl = treeStructureService.ParameterChildElements(node.Value); |
| foreach (IHierarchyElement childElement in childColl) |
| { |
| RadTreeNode cNode = CreateNode(childElement); |
| node.Nodes.Add(cNode); |
| } |
| ParameterTreeView.Nodes.Add(node); |
| } |
Creating a node happens like that:
| private static RadTreeNode CreateNode(IHierarchyElement element) |
| { |
| RadTreeNode node = new RadTreeNode(element.Denotation); |
| node.Value = element.Id; |
| node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack; |
| node.ImageUrl = "~/RadControls/Treeview/Skins/ExampleSkins/ContextMenu/Folder.gif"; |
| node.ExpandedImageUrl = "~/RadControls/Treeview/Skins/ExampleSkins/ContextMenu/FolderOpen.gif"; |
| return node; |
| } |
and expanding a node like that:
| foreach (RadTreeNode node in _root.Nodes) |
| { |
| //RadTreeNode node = CreateNode(element); |
| ICollection<IHierarchyElement> childColl = treeStructureService.ParameterChildElements(node.Value); |
| foreach (IHierarchyElement child in childColl) |
| { |
| RadTreeNode childNode = CreateNode(child); |
| node.Nodes.Add(childNode); |
| } |
| } |
My Problems in short:
Whenever i refresh the page and expand the root items again, already deleted items are shown.
The node items are only shown in layer 1 and 2. Everything beneath these layers has no items.
After refreshing, the duplicate items are missing the images too.