473,396 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using the Treeview Webcontrol

Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="IE"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>

<script runat="server">
sub TreeView_SelectedIndexChanged(s as object, e as TreeViewSelectEventArgs)
lblSelectedNode.text = treeBooks.GetNodeFromIndex(e.NewNode).Text
end sub
</script>

<html>
<head><title>Test</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="True"
OnSelectedIndexChange="TreeView_SelectedIndexChang ed"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelectedNode" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test
and test2, but it doesn't do that, it just displays the items on the screen.
Thanks in advance for any help that is given on this.


Nov 18 '05 #1
2 2034
figured it out.

"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:uU**************@TK2MSFTNGP12.phx.gbl...
Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="IE"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>

<script runat="server">
sub TreeView_SelectedIndexChanged(s as object, e as TreeViewSelectEventArgs) lblSelectedNode.text = treeBooks.GetNodeFromIndex(e.NewNode).Text
end sub
</script>

<html>
<head><title>Test</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="True"
OnSelectedIndexChange="TreeView_SelectedIndexChang ed"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelectedNode" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test and test2, but it doesn't do that, it just displays the items on the screen. Thanks in advance for any help that is given on this.

Nov 18 '05 #2
Hi,

MS TreeView Control is not working properly - as far as I have tested please
try with modified controls.

http://www.aspheute.com/artikel/20020801.htm

get back to me if not getting correctly,

Harsh
"Irishmaninusa"
<jd***@structuctureinteractive.com.takemeoffifyouw antoemailme> wrote in
message news:uU**************@TK2MSFTNGP12.phx.gbl...
Hello,

I am a newbie to asp.net and I am trying to do sample code using the
treeview code, and for some reason it is not displaying the way I would
expect it to display. HEre is the code in question

<%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="IE"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>

<script runat="server">
sub TreeView_SelectedIndexChanged(s as object, e as TreeViewSelectEventArgs) lblSelectedNode.text = treeBooks.GetNodeFromIndex(e.NewNode).Text
end sub
</script>

<html>
<head><title>Test</title></head>
<body>
<form runat="Server">
<IE:TreeView
id="treeBooks"
AutoPostBack="True"
OnSelectedIndexChange="TreeView_SelectedIndexChang ed"
Runat="Server">
<TreeNode Text="Home" >
<TreeNode
Text="test" />
<TreeNode
Text="test2" />
</TreeNode>
</IE:TreeView>
<asp:label id="lblSelectedNode" Runat="server" />
</form>
</body>
</html>

I was expecting a tree view to display a node of Home and then subnodes test and test2, but it doesn't do that, it just displays the items on the screen. Thanks in advance for any help that is given on this.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim M | last post by:
Is there any way to know what node was clicked in a treeview webcontrol where autopostback is false? Thanks in advance.
0
by: clintonG | last post by:
I'm just wondering how rich the TreeView control actually is having never worked with a tree view control. I want to load XML into the tree and I'd like control of the presentation tier by getting...
1
by: Hutty | last post by:
I would like to convert the code below into an asp.net application where I can run it via the web. It works ok for vb.net, but my goal is to do it through the browser. I have in a few areas, in...
0
by: viktor9990 | last post by:
I need to add, delete and move up and down hierarchical information in a treeview webcontrol. (all data is saved in Sql server database and must be shown dynamically in a treeview webcontrol (SDK...
0
by: shen.chang.cs | last post by:
Hi, all, I use .Net V2.0 and WebControl TreeView. I want to have an OnClick() function to handle user click on certain end nodes but not on other nodes. Someone suggested to use a Java...
5
by: david | last post by:
I do not know if there is a treeView control for web form in .NET 1.1. I know there is IE Webcontrol package which has the treeview control for ..net 1.0. I have tested it in .net 1.1 before. It...
7
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to...
1
by: Victor Rodriguez | last post by:
Is there a way that I can have a client side event like oncontextmenu="showfunction();" on each node? thanks, Victor
0
by: Vaibhav Shah | last post by:
Hi, While loading a user control with IE WebControl's tree view in it, on a webpart, i am getting this error. Error: unable to load ~\UserControls\TreeViewControl.ascx Details: Parser Error:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.