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

DataGrid
Version 2.5



What's New
Overview
Features
Reference Book
Licensing
Support



Populating with Data
Columns
Rows
Bottom Bar
Layout and Behavior
Exporting
Skins




Installation

To install APNSoft DataGrid on your machine download and run the distributive APNSoftDataGrid.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 DataGrid ->


Visual Studio .NET Integration

The installer creates Visual Studio .NET toolbox item for APNSoft DataGrid. 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 DataGrid to your Visual Studio .NET

To add the APNSoft DataGrid 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 APNSoftDataGrid.dll assembly, select Open and then Ok. After installation, the file APNSoftDataGrid.dll is in the C:\Program Files\APNSoft\APNSoft DataGrid [version] for ASP.NET [version]\bin\ folder by default.

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

Adding DataGrid to your web application using Visual Studio

Drag the APNSoftDataGrid component icon from the toolbox and drop it in your web form / web user-control. Visual Studio will automatically copy the APNSoftDataGrid.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 APNSoftDataGrid.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="dg" Namespace="APNSoft.WebControls" Assembly="APNSoftDataGrid" %>

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

    <dg:APNSoftDataGrid id="dg1" runat="server" />
    


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

Launching the DataGrid from Code Behind

For more programming flexibility, you can use the built-in API of APNSoft DataGrid, which provides various methods simplifying dynamic DataGrid 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 DataGrid component instance
    APNSoft.WebControls.APNSoftDataGrid dg1 = 
    	new APNSoft.WebControls.APNSoftDataGrid();
    dg1.BasePage = base.Page;
    dg1.ID = "dg1";
    
    //Set component properties
    dg1.SkinFolder = "~/Skins/Classic/";
    dg1.DataSource = ...
    dg1.DataBind();
    
    //Put the DataGrid in the PlaceHolder
    PlaceHolder1.Controls.Add(dg1);
    
    
    [VB.NET]
    
    'Create DataGrid component instance
    dim dg1 as APNSoft.WebControls.APNSoftDataGrid = _
    	new APNSoft.WebControls.APNSoftDataGrid
    dg1.BasePage = Me.Page
    dg1.ID = "dg1"
    
    'Set component properties
    dg1.SkinFolder = "~/Skins/Classic/"
    dg1.DataSource = ...
    dg1.DataBind()
    
    'Put the DataGrid in the PlaceHolder
    PlaceHolder1.Controls.Add(dg1)
    
    




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