Title:
THANK YOU!
Name:
null talent
Date:
11/18/2008 1:07:46 AM
Comment:
Works like a charm! I can't thank you enough.
|
Title:
Hey Its fantastic man, Thanks a lot
Name:
Naveen
Date:
11/17/2008 6:57:47 AM
Comment:
Hey man i was so much worried, but u made me so relaxed. Thanks a lot..
|
Title:
Thanks
Name:
Mr Quach
Date:
11/17/2008 2:58:55 AM
Comment:
Thanks u. I already fixd it. Cause from Oracle parameter
|
Title:
Help me to fix error
Name:
Mr Quach
Date:
11/10/2008 12:35:51 AM
Comment:
I use code C# to oracle but it has an error What can I fix it?
private void PopulateRootLevel() { OracleConnection objConn = new OracleConnection(@"Data Source=SALES;User Id=sa;Password=sa;"); OracleCommand objCommand = new OracleCommand(@"select id,title,(select count(*) FROM Category WHERE parentid=sc.id) childnodecount FROM Category sc where parentID IS NULL", objConn); OracleDataAdapter da = new OracleDataAdapter(objCommand); DataTable dt = new DataTable(); da.Fill(dt); PopulateNodes(dt, TreeView1.Nodes); }
private void PopulateSubLevel(Int32 parentid, TreeNode parentNode) { OracleConnection objConn = new OracleConnection(@"Data Source=SALES;User Id=sa;Password=sa;"); OracleCommand objCommand = new OracleCommand(@"select id,title,(select count(*) FROM Category WHERE parentid=sc.id) childnodecount FROM Category sc where parentID=@parentID", objConn); objCommand.Parameters.Add("@parentID", OracleDbType.Int32).Value = parentid; OracleDataAdapter da = new OracleDataAdapter(objCommand); DataTable dt = new DataTable(); da.Fill(dt); PopulateNodes(dt, parentNode.ChildNodes); }
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { PopulateSubLevel(Int32.Parse(e.Node.Value), e.Node); }
private void PopulateNodes(DataTable dt, TreeNodeCollection nodes) { foreach (DataRow dr in dt.Rows) { TreeNode tn = new TreeNode(); tn.Text = dr["title"].ToString(); tn.Value = dr["id"].ToString(); nodes.Add(tn);
//If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = ((Int32)(dr["childnodecount"]) > 0); // Error at this line: Specified cast is not valid } }
What can I fix it?
Thanks!
|
Title:
need 2 disable a few nodes...help!!!!!
Name:
anu
Date:
10/30/2008 9:11:24 AM
Comment:
great article .i tried it n it helped a lot for a newbie like me..but wat i need is 2 fill the tree with user roles..so some roles can only view certain child nodes..i tried 2 change the query to query by roles too but i belive it dont work that way..so i tot it would be better 2 load all nodes then iterate thru the nodes n disable the nodes which is not required for a certain role....is dat possible..can someone help me with this...
i guess il need the child node which i wanna disable den put it into a for loop right????........thanx in advance..
|
Title:
Please help the last node keep expanding
Name:
Mohamed
Date:
10/29/2008 7:01:10 PM
Comment:
First, thank you very much for dharing the code. I applied the code and it works to one exception my last node keep repeating. Here is my code and my SQL works when run outside it just retun one item but I run the example in my page it keeps adding the same node.
Thanks for your help. Imports System.Data Imports System.Data.SqlClient
Partial Class ManageCategories Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then PopulateRootLevel() End If End Sub
Private Sub PopulateRootLevel()
Dim connectionString As String connectionString = _ ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString Dim objConn As New SqlConnection objConn.ConnectionString = connectionString Dim objCommand As New SqlCommand("SELECT Menu_id as Id, Menu_Name as Name, " _ & "(SELECT COUNT(*) FROM vw_Category_Menu M where m.parent_id= vw_Category_Menu.Menu_id) childnodecount " _ & " FROM vw_Category_Menu Where parent_id is NULL", objConn)
Dim da As New SqlDataAdapter(objCommand) Dim dt As New DataTable() da.Fill(dt)
PopulateNodes(dt, TreeView1.Nodes) End Sub
Private Sub PopulateNodes(ByVal dt As DataTable, _ ByVal nodes As TreeNodeCollection) For Each dr As DataRow In dt.Rows Dim tn As New TreeNode() tn.Text = dr("Name").ToString() tn.Value = dr("Id").ToString() nodes.Add(tn)
'If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = (CInt(dr("childnodecount")) > 0) Next End Sub Private Sub PopulateSubLevel(ByVal parentid As Integer, _ ByVal parentNode As TreeNode) Dim connectionString As String connectionString = _
|
Title:
Its working
Name:
atuda2000
Date:
10/22/2008 1:29:29 AM
Comment:
Hi author.
thanks a lot. the treeview just work nicely. actually it had me write different SQL query to retrieve data from my database. but with just that, i can make good treeview.
i still not exploring the depth anyway. which im gonna do now.
thanks, author. good job. very helpful.
atuda2000
|
Title:
Child node
Name:
Vishal
Date:
10/14/2008 8:52:22 AM
Comment:
Hi This code is working fine.But when i click on last node means there no any child node i want to fetch data related to that node value id from database how i will do it.
Give me reply ASAP
|
Title:
Treeview PopulateOnDemand does not show updated results
Name:
Sat
Date:
10/2/2008 3:28:12 PM
Comment:
Hi, When I expand the node for the first time it executes the PopulateOnDemand method, but then on it is not executing that command. Now the problem is it is showing stale data(when someone changes the info listed in the treeview)
|
Title:
Display Hierarchical Data with TreeView in ASP.NET 2.0
Name:
sai vara prasada rao
Date:
9/20/2008 7:38:08 AM
Comment:
hi ,i have applied the code of tree view in my application but it is not displaying the child nodes when i click on the + (plus sign) it is not at all show the sub node .
plz kindly solve my problem . im posting my code , plz any body solve it and mail it my mail id im providing
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class Messages : System.Web.UI.Page { SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["strcon"]); protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) { PopulateRootLevel();
} } protected void TreeView1_TreeNodeCollapsed(object sender, TreeNodeEventArgs e) { } private void PopulateRootLevel() { SqlCommand cmdscrap = new SqlCommand("select senrolno,SenderName,sbatch, scenter, Semail, Ssubject,SBodytxt,Renrolno, Rname, RBatch, RCenter, REmail, Rsubject, Rbodytxt, DateMsgSend,(select count(*) FROM ibsaf_scrap WHERE senrolno=sc.senrolno) childnodecount FROM ibsaf_scrap sc where senrolno IS not NULL", con); SqlDataAdapter da = new SqlDataAdapter(cmdscrap); DataTable datable = new DataTable(); da.Fill(datable); PopulateNodes(datable, TreeView1.Nodes); } private void PopulateNodes(DataTable dt, TreeNodeCollection nodes) { foreach (DataRow dr in dt.Rows) { TreeNode tn = new TreeNode(); tn.Text = dr["sendername"].ToString(); //tn.Value = dr["senrolno"].ToString(); nodes.Add(tn);
//If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = ((int)dr["childnodecount"] > 0);
my mail id is saivaraprasadarao@gmail.com
|
Title:
Display Hierarchical Data with TreeView in ASP.NET 2.0
Name:
sai vara prasada rao
Date:
9/20/2008 7:35:58 AM
Comment:
hi ,i have applied the code of tree view in my application but it is not displaying the child nodes when i click on the + (plus sign) it is not at all show the sub node .
plz kindly solve my problem . im posting my code , plz any body solve it and mail it my mail id im providing
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class Messages : System.Web.UI.Page { SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["strcon"]); protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) { PopulateRootLevel(); } } protected void TreeView1_TreeNodeCollapsed(object sender, TreeNodeEventArgs e) { } private void PopulateRootLevel() { SqlCommand cmdscrap = new SqlCommand("select senrolno,SenderName,sbatch, scenter, Semail, Ssubject,SBodytxt,Renrolno, Rname, RBatch, RCenter, REmail, Rsubject, Rbodytxt, DateMsgSend,(select count(*) FROM ibsaf_scrap WHERE senrolno=sc.senrolno) childnodecount FROM ibsaf_scrap sc where senrolno IS not NULL", con); SqlDataAdapter da = new SqlDataAdapter(cmdscrap); DataTable datable = new DataTable(); da.Fill(datable); PopulateNodes(datable, TreeView1.Nodes); } private void PopulateNodes(DataTable dt, TreeNodeCollection nodes) { foreach (DataRow dr in dt.Rows) { TreeNode tn = new TreeNode(); tn.Text = dr["sendername"].ToString(); //tn.Value = dr["senrolno"].ToString(); nodes.Add(tn);
//If node has child nodes, then enable on-demand populating tn.PopulateOnDemand = ((int)dr["childnodecount"] > 0);
|
Title:
Muchas gracias
Name:
eliud
Date:
9/17/2008 8:59:08 PM
Comment:
Mil gracias me sirvio de mucho, congrulation :)
|
Title:
it is perfect
Name:
Erol Çağlar - Aygaz IT
Date:
9/15/2008 8:20:09 AM
Comment:
it is running to Oracle.
|
Title:
VERY GOOD
Name:
Mohammad javed Comm-IT India P Ltd.
Date:
9/10/2008 3:06:15 AM
Comment:
Excellent articles..
|
Title:
Help me
Name:
Min
Date:
9/9/2008 4:56:46 AM
Comment:
Help me ~ I've got the error on my sqlcommand
@"select id,title,(select count(*) FROM SampleCategories sc WHERE parentid=sc.id) childnodecount FROM SampleCategories sc where parentID IS NULL",objConn)
da.Fill(dt); <--Error message
anybody help ~~ its made by c#
|
Title:
excellent
Name:
sanjeev
Date:
8/29/2008 5:30:28 AM
Comment:
it is very helpfull to me thanks sanjeev
|
Title:
Perfect
Name:
gaurav mehta
Date:
8/19/2008 2:20:59 AM
Comment:
nothing could better then this
|
Title:
This was great
Name:
Paul
Date:
8/14/2008 10:39:34 AM
Comment:
Fantastic. This works great. I needed to use tree view to list reports in datawarehouse by report type and this fits the bill perfectly.
|
Title:
Thanks
Name:
A.Ibrahim
Date:
8/14/2008 10:12:33 AM
Comment:
Thank you very much Teemu . it's work out
|
Title:
Excellent, gj !!!
Name:
Lancelot.Net
Date:
8/11/2008 11:13:49 AM
Comment:
Simple, easy to understand. Great article! Ty :)
|
Title:
Excellent! !!!!!!!!!!!!
Name:
Srikanta
Date:
8/8/2008 5:42:41 AM
Comment:
This is just grt article
|
Title:
Just Wow Grt !!!
Name:
Swati
Date:
8/5/2008 6:18:45 AM
Comment:
This is just grt article. It helped me to clear my concepts...
|
Title:
Excellent!
Name:
Zee
Date:
8/1/2008 7:34:05 AM
Comment:
After weeks of looking for a good, or even close TreeView example. This worked out great for me. Thanks.
|
Title:
ExpandDepth = 0
Name:
Inv
Date:
7/30/2008 10:05:01 AM
Comment:
Thanks! The most useful part was setting ExpandDepth="0" to TreeView, otherwise, very very weird behavior occured..
|
Title:
Clicking item does not post back
Name:
sangam
Date:
7/29/2008 8:24:41 AM
Comment:
It worked fine for me. Thanks. But clicking any of the item does not lead to post back. What is the reason?
Regards Sangam http://dotnetspidor.blogspot.com/
|
Title:
Data Entry
Name:
Goose
Date:
7/23/2008 9:54:26 PM
Comment:
I was able to get the treeview to populate correctly. My goal is to incorporate other data with the treeview. A data entry like form in treeview mode. Any ideas? Thanks.
|
Title:
Perfect
Name:
Bart
Date:
7/22/2008 5:26:19 AM
Comment:
Hello Teemu Keiski, This is just what I need.
Tks Best regards Bart
|
Title:
Javascript in TreeNodePopulate
Name:
olyvia
Date:
7/22/2008 4:27:57 AM
Comment:
I have a populateondemand treeview. In the TreeNodePopulate event, which is fired on clicking the nodes, I want to put a javascript function. I cannot use RegisterStartUpScript because the event does not post back. Is there any way I can put a javascript function over there?
|
Title:
devx
Name:
Panos
Date:
7/17/2008 5:46:29 AM
Comment:
Thank you so much. Exactly what I was looking for.
|
Title:
nice
Name:
chan myie
Date:
7/17/2008 4:07:13 AM
Comment:
thank u so much that is the thing i need
|
Title:
cool code
Name:
gundevar
Date:
7/16/2008 2:00:37 PM
Comment:
the c# side of the code works with only little tweaking of a local connection string. I did not change anything else. No instance failure for C# code. Thanks a lot Teemu, I've been struggling with this for 2 days. All the best!
|
Title:
Code
Name:
Teemu
Date:
7/11/2008 3:41:20 AM
Comment:
Both VB.NET and C# code were equally tested when I wrote the article and worked 100% in the scenario I used as basis. If you get such failures, your connection string is wrong, you refer wrong objects with different IDs etc. Remember, it cannot match 100% your setup, at least db connection string must be changed.
|
Title:
An error Occured in The C# Code
Name:
Rei Ayanamu
Date:
7/10/2008 11:46:19 PM
Comment:
The c# code of this program is experiencing instance failure....
|
Title:
C# Sample code
Name:
Teemu
Date:
7/8/2008 11:09:11 AM
Comment:
Use the [download sample code] link on top of the page. You'll find the code in C# and VB.NET...
|
Title:
wonderful
Name:
sartaj
Date:
7/8/2008 11:05:25 AM
Comment:
BUT I WANT THE CODE IN C#
|
Title:
TREEVIEW
Name:
SEJAL
Date:
7/2/2008 5:31:49 AM
Comment:
Very nice example....it is very useful...keep going... all the best....
|
Title:
keep state
Name:
Hi
Date:
6/27/2008 5:51:23 AM
Comment:
How to keep the treeview state after tn.NavigateUrl
|
Title:
Simple and Clear example
Name:
Mallikarjun
Date:
6/25/2008 2:23:27 AM
Comment:
Simple and Clear example and works fine
|
Title:
TreeView
Name:
Mark
Date:
6/9/2008 5:19:22 PM
Comment:
Hey, Jim thanks for the advertisement! But I'm going with something that is free, thanks. Good example by the way, Teemu!
|
Title:
tree
Name:
sesha
Date:
6/9/2008 1:37:46 AM
Comment:
usefull
|
Title:
TreeView
Name:
chandar
Date:
6/3/2008 5:25:31 AM
Comment:
Hi Teemu,
It is Fantastic and very good Examples.I appreciate u to give more idea working with that control
|
Title:
Multiple Columns
Name:
Jim
Date:
5/28/2008 6:06:22 PM
Comment:
Here is one that has multiple columns. It still has on-demand populating, postback events and hyper links too.
http://www.DigitalTools.com/GVT.aspx
|
Title:
Gridview Data Entry
Name:
hutty
Date:
5/26/2008 9:36:17 AM
Comment:
Great article. It works for me, which is phase 1. Now I need to incorporate treeview into a gridview data entry form. I had found the perfect article, but PC crashed and I can't find it again. Thanks.
|
Title:
Top to Bottom display
Name:
dosdemon
Date:
5/14/2008 3:30:17 AM
Comment:
how can we display treeview from top- to bottom rather then from left to right.
|
Title:
Displaying data with TreeView
Name:
Ryan
Date:
5/7/2008 6:33:12 AM
Comment:
This is a really good example - Im ashamed to say that I didnt even attempt to code it myself before trawling the net for a solution, but with a couple of tweaks to use Generics for the data (as I do) this worked first time!
Well done Teemu Keiski on such a well written example!
PS. (for earlier poster) there is c# code in the download example..
|
Title:
Displaying Specific data with TreeView
Name:
Cheyne
Date:
5/5/2008 7:26:38 AM
Comment:
Hi,
This code works, but displays ALL of the data on the treeview. But Id like SPECIFIC data to show, depending on who logs into the system.... how do I do that ?
|
Title:
Issue while using TreeNodecollapsed or TreeNodeExpanded events
Name:
Unlimited
Date:
4/30/2008 2:14:17 AM
Comment:
I used the code to implement the dynamic treeview and it worked fine. But when i generated the TreenodeCollapsed and TreenodeExpanded event, then on initial page load it works fine but when i clicks to expand a subfolder it calls treenodeCollapsed first before page load.
Below is my code :
Option Explicit On Option Strict On
Imports System.Web Imports System.Data Imports CHV_ITC_GilFileDetail_1_BL Imports CHV_ITC_GILFileDetail_1_DLR Imports CHV_ITC_GilFileDetail_1_DLW Imports CHV_ITC_GILFileDetail_1_EH
Partial Class TreeView Inherits System.Web.UI.Page
'Global variables Dim dsFolder As DataSet Dim dsSubFolder As DataSet Dim dtGetOverrideDetails As DataTable Dim dtResetOverrideDetails As DataTable Dim objDLR As CHV_ITC_GILFileDetail_1_DLR.DataRead = Nothing Dim objDLW As CHV_ITC_GilFileDetail_1_DLW.DataWrite = Nothing Dim objBLR As CHV_ITC_GilFileDetail_1_BL.BusinessLayer = Nothing Dim folderFlag As Integer = 0 Dim dr As DataRow
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then PopulateRootLevel() txtParentIDs.Attributes.CssStyle.Add("display", "none") End If End Sub
Private Sub PopulateRootLevel() objDLR = New CHV_ITC_GILFileDetail_1_DLR.DataRead dsFolder = objDLR.get_GSPFolderTest("0") PopulateNodes(dsFolder.Tables(0), TreeView1.Nodes) End Sub
Private Sub PopulateNodes(ByVal dt As DataTable, ByVal nodes As TreeNodeCollection) For Each dr In dt.Rows Dim tn As New TreeNode() tn.Text = dr("LASTFOLDER").ToString() tn.Value = dr("FOLDER_SEQ").ToString()
tn.NavigateUrl = "#" tn.SelectAction = TreeNodeSelectAction.Select nodes.Add(tn)
'If node has child nodes, then enable on-demand populating tn.PopulateOnDeman
|
Title:
Doing the same thing by calling a store prodedure
Name:
chame
Date:
4/28/2008 1:06:16 PM
Comment:
Hello,
I am trying to do the same thing but with ASP, there is a store procedure that's we have to do something similar that assign item from the "title" column for example a level number.
So I'm trying to do the same thing but when I call the function for this store procedure, it's display all my data as parent nodes instead of sorting it in the proper order. Do you have any suggestion of how I can get this to function properly since I am calling a stored procedure, and working with ASP?
Thanks in advance!!
|
Title:
You can achieve this with one line of code
Name:
Ralph Varjaberdian
Date:
4/23/2008 7:15:36 AM
Comment:
http://www.varjabedian.net/archive/2008/04/22/binding-asp.net-treeview-to-a-dataset-or-an-objectdatasource.aspx
|
Title:
keeeka
Name:
suribabu
Date:
4/23/2008 3:11:59 AM
Comment:
Dis really helped me a lot Thanq very very much
|
Title:
Good Stuff
Name:
Jeremy
Date:
4/17/2008 5:34:36 PM
Comment:
Hey works for me! Thanks!
|
Title:
Kalyan1982
Name:
Kalyan
Date:
4/17/2008 8:15:39 AM
Comment:
Hi,
In the above example, If I click on Category 2.1.1 on this event
Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TreeView1.SelectedNodeChanged
End Sub
I need to get the whole path which is
Category2/Category 2.1/Category 2.1.1
Please help!
|
Title:
It already is in C#
Name:
Teemu
Date:
4/16/2008 7:15:52 AM
Comment:
See the code download (the link is bit small on top of the article, but it is there :-) ): http://authors.aspalliance.com/joteke/treeviewv2article.zip
|
Title:
.cs file
Name:
tariq
Date:
4/16/2008 5:35:57 AM
Comment:
nice example.i m bigginer pls. can u post same in C# coding.
|
Title:
Thanks a lot...Good example
Name:
anitha
Date:
4/8/2008 9:22:35 AM
Comment:
Example is good
|
Title:
Nice Eplaination
Name:
Nikhil V.Thakre
Date:
4/4/2008 2:21:55 AM
Comment:
Explanation of treeview is very good .........
|
Title:
Great Example
Name:
Raghava.G.N
Date:
4/3/2008 5:08:43 AM
Comment:
Example was excellent by Raghava.G.N raghavagn1@rediffmail.com
|
Title:
Thanks Alot
Name:
Kishor Patil
Date:
4/2/2008 11:09:10 AM
Comment:
Thank's For This Code.... I Need It Too Much...
|
Title:
Thanks
Name:
Serkan SÖNMEZ
Date:
3/27/2008 7:07:54 AM
Comment:
that was great, Thank you Teemu Keiski
|
Title:
Great article
Name:
Juan Fco Roman Ochoa
Date:
3/12/2008 6:10:56 PM
Comment:
Thnaks man , this article is going to be very usefull for me to develop a project given to me, thanks a lot
|
Title:
Great!!
Name:
Jon
Date:
3/11/2008 9:38:20 PM
Comment:
Great Article...
I seriously don't understand why anyone would use VB, when C# is so much better.
|
Title:
very useful article
Name:
Anushka
Date:
3/11/2008 4:51:55 AM
Comment:
Such a nice article.... but can u plz tell me how to change color of a selected node...
|
Title:
Josh
Name:
dilshad
Date:
3/10/2008 8:07:04 AM
Comment:
Thanks....
|
Title:
bindind TreeView with datagrid
Name:
Nishant Singh
Date:
3/5/2008 12:35:49 AM
Comment:
Teemu, that was great. can u throw some light on binding treeview control with a datagrid
|
Title:
Superb Work
Name:
Srinivasan
Date:
2/28/2008 11:27:04 PM
Comment:
t tried the same concept for more than two concepts, but after seeing r code, i got the idea and implemented it...thank u so much.HATS OFF to ur work...
|
Title:
Such a Nice Code
Name:
Jay Mehta
Date:
2/20/2008 1:57:54 PM
Comment:
Such a Nice code that helps me lot. Do you have this type of code for menu control or is it same for menu control?
Thank you
|
Title:
Node refresh
Name:
AP
Date:
2/20/2008 1:39:33 PM
Comment:
Thank you for posting this - it is extremely helpful!
I was wondering how would I be able to extend this further so if I were to add/delete a node in the database via a webform, the parent node of the TreeView would automatically refresh?
|
Title:
Excellent work! - Light Waight
Name:
Venkat Rao Konka
Date:
2/16/2008 12:14:46 AM
Comment:
Nice and simple Snippet. Right usage of Tree View Control. Hope s this gives dare to tree view by programmers. All the Best. Thank You Venkat Konka
|
Title:
Please help!
Name:
Vansana
Date:
2/7/2008 2:28:53 PM
Comment:
Hi all, Greate work!. I got question similiar to the last post. How do I populate another sub under each Category? Say if I have products assiciated with earch category. Hope this making sense.
Thanks inadvance
Vansana
|
Title:
Excellent work!
Name:
Jara
Date:
2/7/2008 3:30:11 AM
Comment:
This is very nice work!!! but how do I associate the categories or subcategories with products to make it like real world stuff? For example if I have CategoryID link to Products table as foreing key.
Thank you very much. Jara
|
Title:
very good
Name:
Ezhil
Date:
2/5/2008 7:15:30 AM
Comment:
Hi, i searched lot for the tree view, It is the best stuff thanks a lot
|
Title:
Nice post
Name:
kalyan
Date:
2/4/2008 4:13:25 PM
Comment:
Your post solved my problem.
|
Title:
Very good stuff
Name:
marty
Date:
2/3/2008 4:59:48 AM
Comment:
i am a newbee and i search a long time and here i found the right stuff very good and thank you :-)
|
Title:
Great
Name:
dammyTosh
Date:
1/24/2008 5:22:43 PM
Comment:
Men u are great it simply solved my 1 week head ache.
|
Title:
See docs
Name:
Teemu
Date:
1/24/2008 1:44:24 AM
Comment:
From: http://technet.microsoft.com/en-us/library/e8z5184w.aspx
Using the TreeView Control with UpdatePanel Controls UpdatePanel controls are used to update selected regions of a page instead of updating the whole page with a postback. The TreeView control can be used inside an UpdatePanel control with the following restrictions:
TreeView callbacks must be associated with asynchronous postbacks, or callback event validation will fail. When you set the PopulateOnDemand property of the TreeNode controls to true, callbacks are enabled. You can use one of the following approaches to ensure that TreeView callbacks work with the UpdatePanel control:
If the TreeView control is not inside an UpdatePanel control, disable callbacks on TreeNode controls that are not part of an asynchronous postback. To do this, set the PopulateOnDemand property to false.
Programmatically refresh all controls that register callbacks during the asynchronous postback. For example, you can place the TreeView control inside an UpdatePanel control. The TreeView control does not have to be in the UpdatePanel control where the asynchronous postback originates, as long as the UpdatePanel control that contains the TreeView control is refreshed.
You must apply styles by using a reference to a Cascading Style Sheet (CSS) class. For example, instead of setting the NodeStyle property by using a property-subproperty attribute, set the style by using the property-CssClass attribute. Similarly, when you use the NodeStyle template to set the style, use the CssClass attribute of the template.
The EnableClientScript property must be true (the default value). In addition, if callbacks are enabled for the TreeView control, you cannot change the EnableClientScript property between asynchronous postbacks.
|
Title:
Integrate with Ajax Issue
Name:
Hardy Wang
Date:
1/23/2008 8:32:47 PM
Comment:
I tried this solution, it works perfectly. Then I tried to embed treeview into a ajax updatepanel, now I comes with some problem
I expand one node, then select some other node (select not expand), by this time TreeNodePopulate and SelectedNodeChanged both will be fired, and then keep clicking on this single node (already selected), TreeNodePopulate envent will be fired again and again which causes sub nodes of first expanded node keep grouping and duplicating.
If I remove updatepanel to use regualar postback mode, I don't have this issue.
Any idea?
|
Title:
I Need Some Other Help
Name:
subhranshu
Date:
1/23/2008 12:19:01 AM
Comment:
How can i show the system data in treeview control... suppose i want to show all c:/ documents..that means c:/ should be the parent one and rest sub-folders should come in chlid like and so on.. and please give the code in c#
|
Title:
I Need Some Other Help
Name:
Subhranshu
Date:
1/23/2008 12:17:03 AM
Comment:
How can i show the system data in treeview control... suppose i want to show all c:/ documents..that means c:/ should be the parent one and rest sub-folders should come in chlid like and so on..
|
Title:
V Good
Name:
Carl
Date:
1/10/2008 5:19:55 PM
Comment:
I was up and running within 2 minutes. Thanks for the excalant example. simple and easy to follow.
|
Title:
Fine
Name:
Rajkumar
Date:
1/4/2008 12:08:37 AM
Comment:
i want to display the data on same window by clicking tree node.so how is possible..can i know that type of code...
|
Title:
its fine,but i want to explorer type treeview to display the data on the same window by clicking on treenodes
Name:
anu
Date:
12/28/2007 12:03:55 AM
Comment:
its fine,but i want to explorer type treeview to display the data on the same window by clicking on treenodes
|
Title:
its fine,but i want to explorer type treeview to display the data on the same window by clicking on treenodes
Name:
anu
Date:
12/28/2007 12:02:25 AM
Comment:
its fine,but i want to explorer type treeview to display the data on the same window by clicking on treenodes
|
Title:
Nods are not accessable, after populating with the help of a button event
Name:
Chandrajit Samanta
Date:
12/20/2007 2:09:31 AM
Comment:
I am using ASP.NET 2.0 Treeview control. During initial page load treeview is not populated. Onclick of a button treeview is papulated. But populating I am trying to access all those nodes from codebehind, using another button click event in the same page. But in the second button click event treeviev control is showing empty, in codebehing, where as the page is still displaying all those populated node. Please tell me how to access all those node from codebehind...
Chandrajit Samanta chandrajit.samanta@gmail.com 9986044300, Bangalore , India
|
Title:
Works but need another help
Name:
Rey
Date:
12/18/2007 12:38:15 PM
Comment:
As I said, I'm new to Expression Web and ASP (though I know VB6 and VFP, and I already implement Treeview in different way).
I was able to avoid re-displaying the treeview everytime clicking node by adding this code in the populatenodes, just after nodes.Add(tn)
tn.NavigateUrl = "javascript:void(0)"
Now, my problem was when you select another node, the previous node change the color to like disabled (its look like revisited link).
My another problem is to get the value of the selected node as I would like to pass the value to open a page browser to display information of the selected node...
Looking forward to any help and link that I could resolve my problem.
Thanks again for the great code!
Rey
|
Title:
It works fine but I need another help
Name:
Rey
Date:
12/18/2007 2:39:13 AM
Comment:
First of all, thank you so much for the sample code. It help me to save time. I am very new to web thing.
Can you please extend your help to me for 2 things that I need to implement.
1. Can the treeview be populated before the page display? Same as the other comment below?
2. In node click event, I need to pass the ID# (not the newid()) so I can open a browser page that contains the information of the node click.
Thanks you in advance.
|
Title:
Node not a member of system.args
Name:
jip
Date:
12/11/2007 10:50:56 PM
Comment:
inline " PopulateSubLevel(CInt(e.Node.Value), e.Node) " it gives me an error message 'Node is not a member of System.Args' can any one him me please....
|
Title:
Wonderful
Name:
Your friend
Date:
12/10/2007 7:07:52 AM
Comment:
Thanks................. Greate job
|
Title:
Thanx
Name:
Siju George
Date:
12/6/2007 3:30:18 AM
Comment:
Thanx so much for this help
www.codepal.co.in
|
Title:
Great article
Name:
Bino
Date:
12/6/2007 1:25:57 AM
Comment:
Nice article, well explained
www.codepal.co.in
|
Title:
Nested Gridview footer total by using javascript
Name:
ram
Date:
12/5/2007 1:34:08 AM
Comment:
I want to display Nested Gridview footer total by using javascript .i am 2 gridviews(gvEmployee(Empcode,sal -fields)(gvDepartment(Deptcode,sal-2fields).I want to display both totals in separate .sal is template field. its v.v.urgent.
thnx
|
Title:
Excellent Example - Need some enhancement
Name:
Cherry
Date:
12/3/2007 12:16:24 PM
Comment:
Above example is working fine. Can you let me know if i want, How to add root node (category 1, category 2, ...) statistically(i.e., not from the database table) along with dynamic (from dataset) parent & child node population?
|
Title:
Sample Code
Name:
Teemu
Date:
12/3/2007 7:35:02 AM
Comment:
See the "Download Sample Code" on top side of the page. There's both C# and VB.NEt code.
|
Title:
C#
Name:
Sujith
Date:
12/3/2007 7:31:19 AM
Comment:
Can you Give me the code for the same in C# asp.net
|
Title:
Great Job!
Name:
Tim
Date:
11/29/2007 1:50:24 PM
Comment:
Great article. I was up and running within 5 minutes. Thanks for being succinct and supplying the code examples.
|
Title:
Anyone get 'Object Expected' error ?
Name:
jake
Date:
11/21/2007 1:11:40 PM
Comment:
this works great, but I can't expand/collapse as the generated javascript causes an 'object expected' error.. anyone have a solution to this ?
|
Title:
Too good for developers
Name:
Chetan Nagar
Date:
11/16/2007 12:51:01 AM
Comment:
This is best implementation of treeview using codes.
|
Title:
Greate work
Name:
Mem
Date:
11/11/2007 11:12:39 AM
Comment:
Well done! simple and efficient. now i have to figure how to retain the selected node state 10X
|
Title:
Thanks, It's a good code :)
Name:
Roberto Londono
Date:
11/7/2007 4:13:35 PM
Comment:
Hey Teemu, Very nice code, It work how exsample in my application very well. If you need reference. Roberto Londono Echeverry Washington State University Education and Public Media rlondono@wsu.edu
|
Title:
Thanks
Name:
Susant
Date:
11/7/2007 5:28:19 AM
Comment:
Hello..
Your article Help me
|
Title:
Where is
Name:
Teemu
Date:
11/5/2007 4:36:06 AM
Comment:
2.1 is title, not parentid. Otherwise, I don't understand what you're referring to. The code sample above contains tested code, which is emphasized on the article examples, and it works just fine with no overflows.
|
Title:
Thanks, It's a good code :)
Name:
Yebay
Date:
11/5/2007 2:17:46 AM
Comment:
This one is a good code, heheheh
but if the parentid is an integer type with the value like 2.1, 2.1.1, 2.1.1.1 it will return 2 to parentid and caused stackoverflow exception, oohohoho so change it to string will solve a problem.
|
Title:
Postback
Name:
Teemu
Date:
11/2/2007 9:31:27 AM
Comment:
As I write in the article: "Note that clicking on the node does cause a postback because I haven’t modified the select action of the populated tree nodes from the defaults. "
|
Title:
A Problem in you treeview
Name:
Ashrafali
Date:
11/2/2007 9:01:29 AM
Comment:
Hello Brother, Thankyou for your solution. It is nice and very helpful to me. But I face one problem. When I click on node's text it got postback and load same data once more.
So please check it and guide me proper solution
thanking you Ashrafali
|
Title:
On Page Load all the Nodes should be expanded ?
Name:
Sehul Soni
Date:
10/30/2007 10:51:56 AM
Comment:
Hi,
This is nice example. Thanks a lot. It helped me lot. Is it possible that at Page Load automatically all the Nodes expanded ? One more bug i found is when I am clicking on Sub Node it is creating whole tree again and again.
help me ?
Reply on sehulsoni@gmail.com
Thanks Sehul
|
Title:
Perform ALL roundtrips on page load first?
Name:
wizkidd
Date:
10/29/2007 12:24:25 AM
Comment:
Is it possible to alter the code so that the tree is entirley populated before at page load? This way we wouldnt have to invoke OnTreeNodeExpanded="TreeView1_TreeNodePopulate" ?? If this was possible, it would eliminate the annoying postback which I find the only poor thing.
Anyone wanna give eliminating the postback a shot?
- WizzKidd
|
Title:
Great Program
Name:
Amit Jha
Date:
10/26/2007 8:35:49 AM
Comment:
Really this program helped me. I am so oblige to you.
|
Title:
TreeView
Name:
CK
Date:
10/5/2007 4:04:31 PM
Comment:
Great Article for displaying data!
(1)Is there a way to display the childnode data onclick of it's parent?
(2) Then I insert all the user's choices in a related table using the following fields.
Projid Type Description
100 Goal PI-1 Blah blah goal choice 1
100 Objective PI-1.1 Blah Blah objective a
100 Goal TI-3 Blah Blah goal choice
100 Objective TI-3.1 Blah Blah objective a
100 Objective TI-3.2 Blah Blah objective b
100 Objective TI-3.3 Blah Blah objective c
After the user submits there data I give a web page which displays everything they entered. I show a Treeview which displays only the Goals and Objectives they selected, but it lists ALL the objectives for each goal. I would like it to show only the objectives with its master goal.
Any help is appreciated! Thank you.
|
Title:
OnTreeNodeExpanded="TreeView1_TreeNodePopulate"
Name:
D.Bopp
Date:
9/28/2007 10:55:47 AM
Comment:
Good piece of code, thanks.
I had to add OnTreeNodeExpanded="TreeView1_TreeNodePopulate" to the TreeView to get it run properly. Took me a while to find that bug.
|
Title:
Tree View
Name:
Adarsh Tated
Date:
9/27/2007 3:04:21 AM
Comment:
Hi I am Adarsh I am Not Able To understand how to populate data from sql server on tree view this Article give me a full support Thanks To Lot
|
Title:
refresh
Name:
dany
Date:
9/25/2007 7:22:10 PM
Comment:
how can i refresh the tree when i updatae my db the problem is when i use the functuion PopulateRootLevel() i get another tree view
|
Title:
Awesome Article
Name:
SM
Date:
9/5/2007 9:14:44 AM
Comment:
...this helped me a lot!
|
Title:
help me in implementing tree view for MS CRM
Name:
Suresh Chinna
Date:
9/4/2007 6:27:33 AM
Comment:
Hi friends,
Can anyone suggest me how to implement treeview control in our aspx page( which is extension of MS CRM application) with the datas across different tables, where datas being stored in MS CRM Database
help me out
PS; give some sample codes for implementing
|
Title:
Please help me!
Name:
Sriram
Date:
8/25/2007 4:54:29 AM
Comment:
Can you suggest me a way of getting the check boxes which are checked in the treeview using the above sample as reference?
|
Title:
Gr8 Article!!!
Name:
Sriram
Date:
8/25/2007 4:52:36 AM
Comment:
This was a great article!!!Thanks a lot! I have a similar requirement and was struggling to get this done!This perfectly works!
|
Title:
Doesn't work in Firefox in my case
Name:
Dimitar Kyuchukov
Date:
8/22/2007 6:06:30 AM
Comment:
The menu works perfectly well in IE but not in Firefox/1.5.0.12. Still Your article is really helpful.
|
Title:
Good One,very Usefull
Name:
Anish V S
Date:
8/18/2007 3:56:32 AM
Comment:
Hi Thanks for your code
|
Title:
Its Really GOOOOOoooooooooooooOOOOOOOD
Name:
ViREnDRa KumAr KohlI
Date:
8/10/2007 4:52:00 AM
Comment:
Hi, Its Really GOOOOOoooooooooooooOOOOOOOD Code, Outstanding................. Very Helpfull to mEeeeeee
|
Title:
New Node
Name:
Claf
Date:
8/8/2007 10:45:02 AM
Comment:
Who insert/delete/update nodes?
|
Title:
Nice One
Name:
Santosh
Date:
7/31/2007 8:41:17 AM
Comment:
nice one .it help me a lot
thanks
|
Title:
Sir
Name:
Crabs
Date:
7/31/2007 6:38:35 AM
Comment:
THANKYOU I love this code so much it is my new girlfriend.
|
Title:
Tnx Alot
Name:
Lior Cohen
Date:
7/28/2007 11:42:04 PM
Comment:
I was strongeld with the treeview for days! this code is perfect , no other words! you trolly help me out!
|
Title:
Tree Node
Name:
Shuchi
Date:
7/19/2007 1:21:29 AM
Comment:
It is Very Good Example
Thanks
|
Title:
TREE nODE
Name:
Rahul P
Date:
7/5/2007 7:39:23 AM
Comment:
Perfect Example Thanks
|
Title:
I get duplicate data on the tree
Name:
Allan
Date:
7/3/2007 7:46:29 PM
Comment:
Hey, thanks for the tutorial, I tried running your code with a stored proc as the sql command argument. In my SQL management studio, I get the correct number of returns. On the tree view, I get exactly 2 sets of them. Where could I have gone astray. I didn't make any other mods except replacing your inline sql with a sproc.
|
Title:
Works good - Save State of Tree?
Name:
James
Date:
6/28/2007 3:01:55 PM
Comment:
This worked out for me. Is their a way to save the state of the tree when you are dynamically populating the treeview, with ought having to iterate through all the nodes? Or can someone point me to a good article that explains how to do this? Thanks
answer to: diablo64@gmail.com
|
Title:
Error if the child node is clicked.
Name:
jossy
Date:
6/28/2007 2:24:47 AM
Comment:
HI its a good code. I am able to populate the tree but if i click the node one more time null point error is comming.
|
Title:
this does not work
Name:
Ritesh
Date:
6/25/2007 9:00:19 AM
Comment:
i had tried the same tutorial but when i click on other controls it still populates tree with same child node again & again what can be the solution...
|
Title:
Image
Name:
Teemu
Date:
6/20/2007 12:04:58 PM
Comment:
Shouldn't setting image for a TreeNode be as simple as setting the ImageUrl property to point to the image? You can also set specifically ExpandImageUrl, CollapseImageUrl, NoExpandImageUrl (though these three are given at the TreeView)
|
Title:
if use image to create organization chart .Is it possible?
Name:
lermpon
Date:
6/20/2007 3:39:44 AM
|