CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 8/25/2004 6:23:18 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 32 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
1 Items, 1 Pages 1 |< << Go >> >|
newtoasp.net
Asp.Net User
Help With TreeView Code8/25/2004 6:23:18 PM

0/0

Edited by ADEC: Please remember to close your < code></ code> tags

I have the following code in vb.net that programatically populates a treeview control from a database. The treeview is in the left frame of a page and I want the "incident" child node send a page to the right frame with additional information about the incident that is gathered from the database. How can I set this up so that It will display only that data that pertains to the individual incident that has been clicked.

Any suggestions are greatly appreciated.



Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'Put user code to initialize the page here

'Put user code to initialize the page here

Dim strConn As String = "workstation id=localhost;packet size=4096;user
id=Ryan_Ferg;password=_pFerg78;data source=(local);persist security
info=False;initial catalog=incident_data_warehouse"

Dim objConn As New SqlConnection(strConn)

Dim objDS As New DataSet

Dim daCPS As New SqlDataAdapter("SELECT CPS_Name, CPS_UIC FROM
Corps_UICs", objConn)

Dim daDiv As New SqlDataAdapter("SELECT Div_Name, DIV_UIC, CPS_UIC from
Division_UICs", objConn)

Dim daBrigade As New SqlDataAdapter("Select BDE_Name, BDE_UIC, DIV_UIC FROM
Brigade_UICs", objConn)

Dim daBattalion As New SqlDataAdapter("Select BN_Name, BN_UIC, BDE_UIC FROM
Battalion_UICs", objConn)

Dim daCompany As New SqlDataAdapter("Select CO_Name, CO_UIC, BN_UIC from
Company_UICs", objConn)

Dim daIncident As New SqlDataAdapter("Select incident_short_description,
incident_type, incident_date_time, Responsible_UIC from Incident_Transactions",
objConn)

daCPS.Fill(objDS, "dtCorps_UICs")
daDiv.Fill(objDS, "dtDivision_UICs")
daBrigade.Fill(objDS, "dtBrigade_UICs")
daBattalion.Fill(objDS, "dtbattalion_UICs")
daCompany.Fill(objDS, "dtCompany_UICs")
daIncident.Fill(objDS, "dtincident_transactions")

objConn.Close()

objDS.Relations.Add("DivToCps", objDS.Tables("dtCorps_UICs").Columns("CPS_UIC"),
objDS.Tables("dtDivision_UICs").Columns("CPS_UIC"))

objDS.Relations.Add("Brigade", objDS.Tables("dtDivision_UICs").Columns("DIV_UIC"),
objDS.Tables("dtBrigade_UICs").Columns("DIV_UIC"))

objDS.Relations.Add("Battalion", objDS.Tables("dtBrigade_UICs").Columns("BDE_UIC"),
objDS.Tables("dtBattalion_UICs").Columns("BDE_UIC"))

objDS.Relations.Add("Company", objDS.Tables("dtBattalion_UICs").Columns("BN_UIC"),
objDS.Tables("dtCompany_UICs").Columns("BN_UIC"))

objDS.Relations.Add("Incident", objDS.Tables("dtCompany_UICs").Columns("CO_UIC"),
objDS.Tables("dtincident_transactions").Columns("Responsible_UIC"))


Dim nodeSupp, nodeProd, Nodebde, NodeBN, NodeCO, NodeIncident As TreeNode
Dim rowSupp, rowProd, rowincident As DataRow
Dim rowbde, rowbn, rowco As DataRow

For Each rowSupp In objDS.Tables("dtCorps_UICs").Rows
nodeSupp = New TreeNode
nodeSupp.Text = rowSupp("CPS_Name")
nodeSupp.ID = rowSupp("CPS_UIC")

TreeView1.Nodes.Add(nodeSupp)

For Each rowProd In rowSupp.GetChildRows("DivToCps")

nodeProd = New TreeNode
nodeProd.Text = rowProd("Div_Name")
nodeProd.ID = rowProd("DIV_UIC")
nodeSupp.Nodes.Add(nodeProd)

For Each rowbde In rowProd.GetChildRows("Brigade")
Nodebde = New TreeNode
Nodebde.Text = rowbde("BDE_Name")
nodeProd.ID = rowbde("BDE_UIC")
nodeProd.Nodes.Add(Nodebde)

For Each rowbn In rowbde.GetChildRows("Battalion")
NodeBN = New TreeNode
NodeBN.Text = rowbn("BN_Name")
NodeBN.ID = rowbn("BN_UIC")
Nodebde.Nodes.Add(NodeBN)

For Each rowco In rowbn.GetChildRows("Company")


NodeCO = New TreeNode
NodeCO.Text = rowco("CO_Name") & " " & "-" & rowco.GetChildRows
("incident").Length & " " & " " & "Incidents"
NodeCO.ID = rowco("CO_UIC")
NodeBN.Nodes.Add(NodeCO)

For Each rowincident In rowco.GetChildRows("incident")

NodeIncident = New TreeNode
NodeIncident.Text = rowincident("incident_short_description") & " "
& " " & " -- " & rowincident("incident_date_time")
NodeIncident.ID = rowincident("incident_type")
NodeCO.Nodes.Add(NodeIncident)
NodeIncident.NavigateUrl = "webform4.aspx"
NodeIncident.Target = "main"

Next

Next
Next

Next
Next

Next

objDS.Dispose()
daCPS.Dispose()
daDiv.Dispose()
daBrigade.Dispose()
objConn.Close()
objConn.Dispose()

End Sub

End Class
1 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro .NET 2.0 Windows Forms and Custom Controls in C#: From Professional to Expert Authors: Matthew MacDonald, Pages: 1037, Published: 2005
Compaq Visual Fortran: A Guide to Creating Windows Applications Authors: Norman Lawrence, Pages: 462, Published: 2002
Beginning Python Authors: Peter Norton, Alex Samuel, Dave Aitel, Eric Foster-Johnson, Leonard Richardson, Jason Diamond, Michael Roberts, Aleatha Parker, Pages: 649, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Creating Client Extranets with Sharepoint 2003 Authors: Mark E. Gerow, Pages: 216, Published: 2006
Professional ASP.NET 2.0 Server Control and Component Development Authors: Shahram Khosravi, Pages: 1186, Published: 2006
Access 2003 VBA Programmer's Reference: programmer's reference Authors: Patricia Cardoza, Patricia DiGiacomo, Teresa Hennig, Graham Seach, Armen Stein, Pages: 984, Published: 2004
Visual Basic 6 Complete Authors: Steve Brown, Pages: 1040, Published: 1999
Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005 Authors: Matthew MacDonald, Pages: 1036, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005

Web:
CodeProject: Enhanced BrowseForFolder styled TreeView. Free source ... Great code. One question if I may: I would like the treeview to display normal ... code source project. but I couldn't run it. I use VS2008. Can u help me. ...
CodeProject: Easy DHTML treeview. Free source code and programming ... we have used this treeview in my project & it's excellent, but i need some help in modifying it. what i need for my project that the user can expand one ...
VB TreeView To help assist in the understanding of treeview notification messages, and what specific treeview events cause them to occur, a code module is included that ...
TreeView: JavaScript DHTML Tree Menu As web technology is evolving, so too is the treeview code. As the script has evolved, we have maintained a high level of cross-browser compatibility and, ...
Treeview JavaScript tree menu As web technology evolved, so did the treeview code. Along the way, the code was completely re-written a few times. The script was quick to evolve and take ...
Need Help with TreeView - dBforums Need Help with TreeView Microsoft Access. ... the node in the TreeView to show the Product Code and Product Name when a category is clicked. ...
.NET csharp TreeView 2.0 Help Please - Petzold Code Included TreeView 2.0 Help Please - Petzold Code Included - Tom. 22-Feb-08 11:20:57. I'm looking for help solving a particular quirk in Petzold's ...
Treeview Code Talk about Treeview Code. ... Reload this Page Treeview Code ... Media, The Lounge, General Computer Discussion, General Help Related Topics ...
F1 Technologies Blog: Cool Tree View Code The following segment of code is something that I wrote a while ago when implementing a tree view in a form I was working on. I wanted to try something new ...
Help on TreeView blowing up during post back - ASP.NET Forums The rest of the page worked fine until I added the treeview control and the beloow code. Any help would be appreciated. thanks in advance. ...

Videos:
GCCS97 #150 Proceedings of the GCC Developers Summit 2007 From http://ols.108.redhat.com/2007/GCC-Reprints/GCC2007-Proceedings.pdf . the ability to watch the internal execution of a program at ...
GCCS97 #146 Proceedings of the GCC Developers Summit 2007 From http://ols.108.redhat.com/2007/GCC-Reprints/GCC2007-Proceedings.pdf . leaving many node attributes out. Figure 2: Syntax of paramet...
GCCS97 #148 Proceedings of the GCC Developers Summit 2007 From http://ols.108.redhat.com/2007/GCC-Reprints/GCC2007-Proceedings.pdf . GIMPLE nodes in the GIMPLE tree view area, and highlights ...




Search This Site:










save and return

display message for valid user without authorization

need to pole ldap server versu sqlroleprovider

display "logout <username>" as logout link for loginstatus

return url ? authenticate twice?

deactivating a field based on user access

asp.net login controls or not?

trustlevel issue

required field validator not working in createuser wizard

security exception with attachment attachfile

access is denied - please help

web application not work

vwd, ms access and membership

thread.currentprincipal

querystring - security risk?

url forwarding and forms auth

help passing authentication from root application to sub level application

permissions sometimes carry over for second user to sign in

adding tables to aspnetdb.mdf

md5 troubles? different hashes than with perl's md5 module?

need advice on module role security

setting default button in createuserwizard

more com problems

don't like security question when using createuserwizard control

exposing the permissions dialog box in asp.net

simple login with a membership provider that works?

membership/roles help

can't deny access to directory using the memberhship role

impersonation issue and access denied error

setting dissallowed usernames?

  Privacy | Contact Us
All Times Are GMT