Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ASP.net Incorporating a customized TreeView control into my project

Posted on 2012-08-19
3
Medium Priority
?
1,016 Views
Last Modified: 2012-08-19
Hi

I have an ASP.net VB.net web app that I want to incorporate a customized TreeView
into.
It is the version 3.3 at the link
http://www.codeproject.com/Articles/43057/ASTreeView-Free-ASP-NET-TreeView-Control

The code is fairly complex for me and wanted to know if there is an easy way to incorporate a simple TreeView using this into my project. Can I cut and paste certain files? I'm not sure
as to how to go about this..
0
Comment
Question by:Murray Brown
3 Comments
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 1200 total points
ID: 38309622
Add Reference - > ASTreeView.dll
Images from demo/Javascript from demo folder which you used before
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="vbVersion.aspx.vb" Inherits="vbVersion" %>
<%@ Register Assembly="ASTreeView" Namespace="Geekees.Common.Controls" TagPrefix="ct" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    	<link href="<%=ResolveUrl("~/javascript/astreeview/astreeview.css")%>" type="text/css" rel="stylesheet" />
	<link href="<%=ResolveUrl("~/javascript/contextmenu/contextmenu.css")%>" type="text/css" rel="stylesheet" />
	
	<script src="<%=ResolveUrl("~/javascript/astreeview/astreeview_packed.js")%>" type="text/javascript"></script>
	<script src="<%=ResolveUrl("~/javascript/contextmenu/contextmenu_packed.js")%>" type="text/javascript"></script>
    <script type="text/javascript">

	</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <ct:ASTreeView ID="astvMyTree" 
				runat="server"
				BasePath="~/Javascript/astreeview/"
				DataTableRootNodeValue="0"
				EnableRoot="false" 
				EnableNodeSelection="false" 
				EnableCheckbox="true" 
				EnableDragDrop="true" 
				EnableTreeLines="true"
				EnableNodeIcon="true"
				EnableCustomizedNodeIcon="true"
				EnableContextMenu="true"
				EnableDebugMode="false"
				EnableContextMenuAdd="false"
				OnNodeDragAndDropCompletingScript="dndCompletingHandler( elem, newParent )"
				OnNodeDragAndDropCompletedScript="dndCompletedHandler( elem, newParent )"
				OnNodeDragAndDropStartScript="dndStartHandler( elem )"
				EnableMultiLineEdit="false"
				EnableEscapeInput="false" />
    </div>
        
    </form>
</body>
</html>

Open in new window

Imports Geekees.Common.Controls
Imports Geekees.Common.Utilities
Partial Class vbVersion
    Inherits System.Web.UI.Page
    Private Sub GenerateTree()
        Dim n As New ASTreeViewLinkNode("Picasa", "Picasa", "http://picasaweb.google.com", "frm", "Goto Picasa", "~/Images/demoIcons/picasa.gif")
        n.NodeText = "The node cannot have children."
        n.EnableChildren = False
        n.EnableEditContextMenu = False
        Me.astvMyTree.RootNode.AppendChild(New ASTreeViewLinkNode("GM", "GM", "http://www.gm.com", "frm", "Goto GM.com", "~/Images/demoIcons/gm.gif").AppendChild(New ASTreeViewLinkNode("Hummer", "Hummer", "http://www.hummer.com", "frm", "Goto Hummer.com", "~/Images/demoIcons/hummer.gif")).AppendChild(New ASTreeViewLinkNode("Cadillac", "Cadillac", "http://www.cadillac.com", "frm", "Goto Cadillac.com", "~/Images/demoIcons/cadillac.gif")).AppendChild(New ASTreeViewLinkNode("SAAB", "SAAB", "http://www.saab.com", "frm", "Goto SAAB.com", "~/Images/demoIcons/saab.gif"))).AppendChild(New ASTreeViewLinkNode("Google", "Google Site", "http://www.google.com", "frm", "Goto Google", "~/Images/demoIcons/google.gif").AppendChild(New ASTreeViewLinkNode("Picasa", "Picasa", "http://picasaweb.google.com", "frm", "Goto Picasa", "~/Images/demoIcons/picasa.gif"))).AppendChild(New ASTreeViewLinkNode("Microsoft", "Microsoft", "http://www.microsoft.com", "frm", "Goto Microsoft", "~/Images/demoIcons/microsoft.gif").AppendChild(New ASTreeViewLinkNode("MSDN", "MSDN", "http://www.msdn.com", "frm", "Goto MSDN", "~/Images/demoIcons/msdn.gif"))).AppendChild(New ASTreeViewLinkNode("Amazon", "Amazon", "http://www.amazon.com", "frm", "Goto Amazon", "~/Images/demoIcons/amazon.gif").AppendChild(n)).AppendChild(New ASTreeViewLinkNode("<font style='color:blue;font-weight:bold;font-style:italic;' isTreeNodeChild='true'>ASTreeView</font>", "Best Free TreeView Control for ASP.Net", "http://www.astreeview.com", "frm", "Html as TreeNode Text", "~/Images/demoIcons/ast.gif"))        '			
    End Sub

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
          If Not IsPostBack Then
            GenerateTree()
        End If
    End Sub
End Class

Open in new window

FileUsed.png
0
 
LVL 20

Assisted Solution

by:informaniac
informaniac earned 800 total points
ID: 38309623
There is a sample project in the zip. You can refer that.

You need to add reference of the dll file to your project.

Copy the xml file to your bin folder.

Copy the xsd and the Javascript folder to your project.
0
 

Author Closing Comment

by:Murray Brown
ID: 38309751
Thanks very much
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Loops Section Overview
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question