ASP.NET - html5 treeview

Asked By sri on 29-Feb-12 05:23 AM
Hi to All,
i want use treeview control in html5 ,but am not able to get it. how to get it. plz help me.
kalpana aparnathi replied to sri on 29-Feb-12 05:33 AM
hi,

Try below example code:
for (int i = 0; i < dt.Rows.Count; i++)
{
string nodeName = dt.Rows[i][2].ToString();
TreeNodeCollection nodes = TreeView1.Nodes;
FindNodeInHierarchy(nodeName);
 
if (!m_bNodeFound)
{
TreeNode root2 = new TreeNode();
root2.Text = dt.Rows[i][2].ToString();
root2.Value = dt.Rows[i][0].ToString();
TreeView1.Nodes.Add(root2);
}
 
else
{
string expression = "PARENT_PK = " + dt.Rows[i][0].ToString();
DataRow[] foundRows;
foundRows = dt.Select(expression);
//FindNodeByValue(nodes, dt.Rows[i][0].ToString());
FindNodeByValue(nodeName);
if (intNodeFound == true)
{
tn = TreeView1.FindNode(Server.HtmlEncode(sValuepath.Trim()));
}
for (int j = 0; j < foundRows.Length; j++)
{
TreeNode root1 = new TreeNode();
root1.Text = foundRows[j][2].ToString();
root1.Value = foundRows[j][0].ToString();
tn.ChildNodes.Add(root1);
}
}
 
}


Regards,
D Company replied to sri on 29-Feb-12 08:17 AM
If i'm not wrong there is no treeview in HTMl5, but u can do this in some other way using some tools like this or some other framework having good UI like this

or alternatively use custom data attributes for same task seee this example

Hope it helps
Regards
D