HierarchyData ClassChart4.NET - Organization Charting Component (C#/VB.NET/ASP.NET) - Documentation
Onlinewww.Chart4.NET (Documentation) | OnlineSamples Download | Release Notes

Property collection of Data-binding/import and node-customization methods for hierarchy controls, accessible through HierarchyWin-hpcData and HierarchyWeb-hpcData property. [h]iearachy [p]roperty [c]ollection of [Data].
Inheritance Hierarchy

System Object
  UnifoChart.Hierarchy HierarchyData

Namespace: UnifoChart.Hierarchy
Assembly: UnifoChart.Hierarchy (in UnifoChart.Hierarchy.dll) Version: 5.1.0.0 (5.1.0)
Syntax

public sealed class HierarchyData
public final class HierarchyData
Remarks

Following is a sample database connection to fill the data:
hierarchy1.hpcData.PhotoSpecification = PhotoSpecificationType.ByFileName;
System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection();
conn.ConnectionString = "Driver={SQL Server};Server=.\\SQLEXPRESS;Database=test1;Trusted_Connection=Yes;";
//Check sResult for any errors 
string sResult = hierarchy1.hpcData.LoadFromDatabase( 
        conn, "Parc", "id", "pid", "txt", "", "", "tooltip", "imagefile" );
hierarchy1.hpDataTree.ExpandAll( );            
hierarchy1.Refresh( );

Following is the sample table:
CREATE TABLE [dbo].[Parc](
    [id] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [pid] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [txt] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
    [value] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [tooltip] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [imagefile] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

Following is the sample data:
            id	pid	txt	value	tooltip	imagefile
            -----------------------------------------------
            1	0	Text1	NULL	NULL	add.png
            2	6	Text2	NULL	NULL	NULL
            3	1	Text3	NULL	tooltip1	add.png
            4		Text4	NULL	NULL	NULL
            5	2	Text5	NULL	NULL	NULL
            6	NULL	Text6	NULL	NULL	NULL
            

  • See also OnlineHow to Create Organization Chart from Database/ODBC.
  • Use LoadFromDatabase() with an SQL query, to provide extra information (eg:url, tag etc.).
  • If you use an SQL query, put the standard names (Id, ParentId, text, value, tooltip, photo, url, tag) for the columns of the table.
  • Alternately you can use column aliases:
    SELECT    column1 AS Id, 
                column2 AS ParentId, 
                column3 AS [text], 
                column4 AS [value], 
                column5 AS tooltip, 
                column6 AS photo, 
                column7 AS url, 
                column8 AS tag
    FROM    Parc
    WHERE    location=7
  • See LoadFromXmlFile() for the desired XML format and remarks.
See Also