hi,
I am showing record in treeview format using asp .net treeview control.
Note:
+
and
-
is treenode expand event and tree1,tree1.1,tree2,tree2.1,tree2.2 are treenode change event. this we know generally.
for example:
+ tree1
- tree1.1
-tree1.2
+ tree2
-tree2.1
-tree2.2
so, i took my data from data base and formed in treeview format. till now everything works fine.
the problem is that: when i click + on tree1 family , it expands it's child---> here also no issue.
and secondly when i click + on tree2 family , it expands it's child----> here the first family (ie tree1) should collapse automatically. right? but it is not doing. that is the issue.
Note: here when you click + and - , no loading or postpack. just expand.
so, i used one coding follows which solves that problem. but it is loading or does post pack. so, it faces slow just expand and collapse.
bool Block = false;
protected void tree_expand(object sender, TreeNodeEventArgs e)
{
if (Block == true)
return;
Block = true;
treeview1.CollapseAll();
TreeNode Node = e.Node;
while (Node != null)
{
Node.Expand();
Node = Node.Parent;
Node = Node.Parent;
}
Block = false;
}
please help me out..lead me in right way. thank you. somebody says use jquery plugin with json. but i am not able find exact coding or step by step to do that. so, i have done normal asp.net treeview. if you solve atleast the problem , it will be more helpful.