CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 12/2/2004 3:39:20 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 34 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
mlogan
Asp.Net User
Database bound Tree View adding Nodes12/2/2004 3:39:20 AM

0/0

I am trying to add a node under existing nodes, but making sure they don't exist before putting adding it.

Here is my Code


Public Sub BuildTree()

.... above this, root nodes were added.

For Each dr In drs
Dim childnode As TreeNode = nTreeNode(dr("ROLE_DESC"), dr("ROLE_ID"), dr("REL_ROLE_ID"))
Dim parentnode As TreeNode = treeRoles.FindControl(dr("REL_ROLE_ID"))
If treeRoles.Nodes.Contains(childnode) = False Then
treeRoles.Nodes.AddAt(treeRoles.Nodes.IndexOf(parentnode), childnode)
End If
Next

End Sub

Public Function TreeNode(ByVal strText As String, ByVal strID As String, ByVal strNodeData As Object) As TreeNode
Dim tn As New TreeNode
tn.Text = strText
tn.ID = strID
If IsDBNull(strNodeData) = False Then
tn.NodeData = strNodeData
Else
tn.NodeData = ""
End If
Return tn
End Function


I am trying to set parentnode as a reference to the parent node. However, the FindControl method cannot be converted to a TreeNode type. Is there another way to do this. This TreeView is bound to a database and all the data is in one table. The table contain a primaryID (ROLE_ID) and ParentID(REL_ROLE_ID), where the ParentID is the PrimaryID of the rows parent.

ie

Table1
ROLE_ID REL_ROLE_ID
1
2 1
3 1
4
5 4
6 4
7 4
8 7
9 7
10 7

This table should produce the following tree

1
-- 2
-- 3
4
-- 5
-- 6
-- 7
-- -- 8
-- -- 9
-- -- 10

Thanks in advance.
If I provided an answer to a question please mark it as an answer.

- For the Web Services Forum please state your environment. For example,
- Client .Net 1.1 with WSE 2.0 calling .Net WSE 3.0 service, behind proxy. This information assists us in resolving your problems.
mlogan
Asp.Net User
Re: Database bound Tree View adding Nodes12/3/2004 2:09:19 PM

0/0

Well I figured it out myself using this link:

http://www.dotnet247.com/247reference/msgs/24/123458.aspx

I needed to add the nodes recursively, calling a function and then that function calls itself.


If I provided an answer to a question please mark it as an answer.

- For the Web Services Forum please state your environment. For example,
- Client .Net 1.1 with WSE 2.0 calling .Net WSE 3.0 service, behind proxy. This information assists us in resolving your problems.
vtmtram
Asp.Net User
Re: Database bound Tree View adding Nodes1/6/2005 10:44:54 AM

0/0

u copy folder images from Runtime (when u setup IEWebcontrol) to your project.Define it locate in Inetpub\wwwroot\name of your project. Put folder image in wwwroot not in your project. Because this dll use this driver to show images.
I hope u can drawing a treeview
diver_98
Asp.Net User
Re: Database bound Tree View adding Nodes1/6/2005 12:12:00 PM

0/0

I have the same table set up in my sql 2000 db but instead of integer i have string values to reflect the organisational structure.
ie
OUId OUParentID

PP
PPE PP
PPEA PPE
PPEC PPE
PPC PP
PPC1 PPC
PPC2 PPC

aso

May I get some support how to build such a treeview in a WEB Form using VB

Thanks in advance




4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
ASP.NET 2.0 Black Book: black book Authors: Dreamtech Software, Dreamtech Software, Charul Shukla, Anil Kumar Barnwal, Dreamtech Software India, Pages: 1167, Published: 2006
Pro ASP.NET 2.0 in VB 2005: special edition. Authors: Laurence Moroney, Matthew MacDonald, Pages: 1360, Published: 2006
Database Programming Languages: 8th International Workshop, DBPL 2001, Frascati, Italy, September 8-10, 2001 : Revised Papers Authors: G. Grahne, Giorgio Ghelli, Pages: 341, Published: 2001
Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath Authors: Eric Carter, Eric Lippert, Pages: 992, Published: 2006
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Beginning InfoPath 2003 Authors: F. Scott Barker, Pages: 384, Published: 2005

Web:
Database bound Tree View adding Nodes - ASP.NET Forums Re: Database bound Tree View adding Nodes. 12-03-2004, 9:09 AM. Contact ... Re: Database bound Tree View adding Nodes. 01-06-2005, 5:44 AM ...
TreeView Control Scenario: Binding the TreeView to the Biblio.MDB ... It is possible to bind the data from a database to a TreeView control. .... If one is found, add a Node ' object to the TreeView control, and set the ' new ...
microsoft.public.dotnet.framework.aspnet.webcontrols: RE: Proble ... loop through all the rows and add nodes according the rows , but you meet ... RE : Proble with TreeView IE Web Controls / Database Bound ...
Binding Treeview to Sitemap - Adding dynamic items I have a treeview bound to a sitemap. Once the user is logged in, I'm ... specified data from the database. lastly, create child nodes from ...
CodeGuru Forums - TreeView Jun 21, 2001 ... A second way of adding nodes is to declare an object variable of type ... To bind a database to the TreeView control, you must first add a ...
"Tree View" with a SQL Server Database - MS SQL Jul 20, 2005 ... tree view needs to be bound to a SQL Server database. ... Adding a new node is simple given the parent, you just find the highest ...
CodeProject: Data Binding TreeView in C#. Free source code and ... Aug 3, 2004 ... The TreeView control can be bound to any data source supporting IList or IListSource . .... Can i add Another node after Book Title? ...
Extending the TreeView Control Designing a Data-Bound Tree View. Adding data binding to the TreeView control is a .... In my TreeView, only the leaf nodes (final node in the hierarchy) ...
15 Seconds : The ASP.NET 2.0 TreeView Control TreeView is one of the important controls that can be easily bound to data source ..... treeview nodes dynamically with the contents from the database. ...
Binding a TreeView to a DataSet « Josh Smith on WPF May 5, 2007 ... When you run the demo application and expand the root nodes, the TreeView looks like this:. The bound TreeView ...

Videos:
A Googly MySQL Cluster Talk Google TechTalks April 28, 2006 Stewart Smith Stewart Smith works for MySQL AB as a software engineer working on MySQL Cluster. He is an ...




Search This Site:










change site map provider at runtime

sitemap questions

1

setting focus on a button and a textbox

placing my database on another server

vs 2003 application structure does not work in vs 2005 (part i)

remove project from solution, lose reference??

module name: bpm personal stockticker

log out problem in using forms authentication

web fusion lack of assistance on dnn - can anyone help! please

’aspnet_membership’ table gets the wrong time for the ‘lastlogindate’ field

creating user accounts

prevent overriding html header attributes of a master page

dataprovider.instance().gethostsettings

<zonetemplate><% ... %></zonetemplate>

crl checking

designer context

getting a control ready to be programmed during postback event

opening new session

extending membership and roles?

please find out the solution for this error

roll over menu for my master page ?

how to do wildcard mapping in iis 5.1?

simple membership & roles question

how to unload the sitemapprovider-cache?

dnn3 and windows 2003

how to create configure security settings for web application?

custom sitemapprovider retaining old values

books on building server control

treeview-is this possible?

 
All Times Are GMT