Wednesday, March 28, 2012

Tree view control with ajax

Hello,

I dont know, is this the right thread to post my prob. Here is my problem. I have a tree view control in a master page. I have created that tree view from "treeview.xml" file. I have created this file from database table. In this tree view, more than one node may have same name. My table has four fields - nodeid, nodename, parentid and lavel. The xml file looks like...

<?xml version='1.0' encoding='utf-8' ?>
<rootNode>
<siteNode title="root" id="1">
<siteNode title="my document" id="3">
<siteNode title="my films" id="31">
<siteNode title="bengalis" id="33">
<siteNode title="aaa102" id="102" />
<siteNode title="aaa106" id="106">
<siteNode title="xxxx1" id="1051" />
<siteNode title="xxxx1" id="1053" />
<siteNode title="zzzz2" id="1059" />
...
...
Every node may have more than one information. All these informations are stored in a different file with "nodeid". What I want is that when any one click on any node I want to display all the information stored in that node in the "Conten Page" with the help of Ajax. For that I need the id of that selected node. How can I access the node id?

Angshujit

Do you want the tree view to dynamically add nodes when you click one of the nodes? If so, you will have a lot of problems using the built in controls for that because the treeview is not supported inside an update panel. You can generally have a treeview in an update panel if it doesn't change the contents, but if you want it to change after page load, you should look at getting a 3rd part control for it.

Hello,

Thank you for your reply. No, I dont want so at present. Actually what is became my headache is how to get the id of the node.

protectedvoid SelectedNodeChanged(object sender,EventArgs e)

{

string id = treeView1.SelectedNode.?

Because without knowing the id I cannot search the table for contents belongs to that node. I cannot usetreeView1.SelectedNode.Text becasue there may be more than one nodes with same text. Is there any way to solve it? Please help me.

Angshujit

No comments:

Post a Comment