|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Turning URL Navigation off on a Treeviewthe page is loaded. I am trying to figure out how to take the treeview out of navigation mode. That is to say that the text for a node should NOT be a hyperlink. According to all of the docs I have found, setting the NavigateURL to an empty string will do this for me. This does not seem to work. suggestions? My Original Code: TreeNode _root = new TreeNode("Fault Code Filter"); tree.Nodes.Add(_root); Tried this: TreeNode _root = new TreeNode("Fault Code Filter","-1","","",""); And this TreeNode _root = new TreeNode("Fault Code Filter","-1","","",""); _root.NavigateUrl = ""; Also this: TreeNode _root = new TreeNode("Fault Code Filter","-1","","",""); _root.NavigateUrl = null; -- John Bankhead The only way i have found to remove hyperlink in a TreeView is to
iterate the TreeNodeCollection recusively and set the SelectAction to TreeNodeSelectAction.None Here's an example: //recursive method internal TreeView RemoveHyperLinks(TreeView treeView, TreeNodeCollection treeNodes) { foreach (TreeNode node in treeNodes) { node.SelectAction = TreeNodeSelectAction.None;//here the link is removed if (node.ChildNodes != null && node.ChildNodes.Count > 0) { treeView = RemoveHyperLinks(treeView, node.ChildNodes); } } return treeView; } //initial call: _treeView = RemoveHyperLinks(_treeView, _treeView.Nodes); Let me know if this works for you thx //AndersR
how to map the given name to different domain
FormView problem with Templates and Tables Design View when using an ASP:Panel to show/hide groups of <tr>'s DropDownlist in EditItemTemplate Gridview Problem TabStrip change by javascript Failed to load viewstate. IConvertible Error IE-7 Where the webforms forums? ITemplate |
|||||||||||||||||||||||