APNSoft - Web Controls, components for ASP.NET Home Help Center Contact Us
About UsProductsDownloadsPurchase
Support

TreeView
Version 3.0



What's New
Overview
Features
Reference Book
Licensing
Support



Populating with Data
Layout and Behavior
Design
Programming




Installation

To install APNSoft TreeView on your machine download and run the distributive APNSoftTreeView.msi. The .MSI installers are intended for easy and automatic installation of a product. The .MSI installs the control on your computer to a folder named APNSoft in your Program Files and automatically creates the necessary virtual folder. After installation procedure you can open the page with Reference Book, Code Samples, Online Examples, etc. by this shortcut:

Start Menu -> Programs -> APNSoft TreeView ->


Visual Studio .NET Integration

The installer creates Visual Studio .NET toolbox item for APNSoft TreeView. This item is visible under the APNSoft tab when you open a new or existing ASP.NET Web application and when you create or edit an ASPX page.


Manually adding the TreeView to your Visual Studio .NET

To add the APNSoft TreeView control to your Visual Studio project please follow these steps:

  1. Open the toolbox.
  2. Right click it and open Choose Items ... (Add/Remove Items).
  3. Click Browse in the dialog;
  4. Find the APNSoftTreeView.dll assembly, select Open and then Ok. After installation, the file APNSoftTreeView.dll is in the C:\Program Files\APNSoft\APNSoft TreeView [version] for ASP.NET [version]\bin\ folder by default.

    APNSoftTreeView component will appear in toolbox and you can add it to a page:

Adding TreeView to your web application using Visual Studio

Drag the APNSoftTreeView component icon from the toolbox and drop it in your web form / web user-control. Visual Studio will automatically copy the APNSoftTreeView.dll to the bin folder of your web application and will create the respective Reference.

All of the properties are listed in the properties panel in Visual Studio and can be grouped:



Manually embedding the Control into the page
  1. Copy the APNSoftTreeView.dll assembly into the bin directory of your web application.
  2. Add the following line of code (without line breaks) to the top of your page:

    <%@ Register TagPrefix="tv" Namespace="APNSoft.WebControls" Assembly="APNSoftTreeView" %>

  3. Add the following line of code anywhere within your page to embed the TreeView:

    <tv:APNSoftTreeView id="tv1" runat="server" />
    

    Now you can open the page in your browser to see output.

Launching the TreeView from Code Behind

For more programming flexibility, you can use the built-in API of APNSoft TreeView, which provides various methods simplifying dynamic TreeView creation.

We recommend using the PlaceHolder as a container to store dynamically added server controls on the Web page. The PlaceHolder is a standard Web Forms control.
  1. Put the PlaceHolder somewhere on your Web page

    <asp:PlaceHolder id = PlaceHolder1 runat = "server" />
    


  2. Put code in Code Behind

    [C#]
    
    //Create TreeView component instance
    APNSoft.WebControls.APNSoftTreeView tv1 = 
    	new APNSoft.WebControls.APNSoftTreeView();
    tv1.BasePage = base.Page;
    tv1.ID = "tv1";
    
    //Set component properties
    tv1.StructureFileURL = "~/Structures/TreeView.xml";
    tv1.SkinFolderURL = "~/Skins/Classic/";
    tv1.ShowLines = true;
    
    //Put the TreeView in the PlaceHolder
    PlaceHolder1.Controls.Add(tv1);
    
    
    [VB.NET]
    
    'Create TreeView component instance
    dim tv1 as APNSoft.WebControls.APNSoftTreeView = _
    	new APNSoft.WebControls.APNSoftTreeView
    tv1.BasePage = Me.Page
    tv1.ID = "tv1"
    
    'Set component properties
    tv1.StructureFileURL = "~/Structures/TreeView.xml"
    tv1.SkinFolderURL = "~/Skins/Classic/"
    tv1.ShowLines = True
    
    'Put the TreeView in the PlaceHolder
    PlaceHolder1.Controls.Add(tv1)
    
    





  © 2003-2008 APNSoft. All rights reserved. Table of Contents   Terms of use   Contact Us   Help Center