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

Loads data from an XML file. See example below for the desired Xml format.

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

public string LoadFromXmlFile(
	string FilePath
public String LoadFromXmlFile(
	String FilePath


Type: OnlineSystem String
Filename including the path of the file, that has valid XML content. FilePath can be a full local path or a web address.

Return Value

Returns blank if succeeded, XML validation message otherwise.

  • All the attributes in 'item' tag is optional. If you want to set a different tooltip (other than text), node value or photo index, use the following attributes:
    <item text='What\nis\nhierarchy?' value='NodeH' tooltip='About' photo='0' url='#idWhat'/>
  • The 'value' attribute in tags is not mandatory. If you are to give values, ensure that the given values are unique. Otherwise the nodes cannot be identified correctly.
  • Content of any attribute other than the specified ones will be added to the text of the node.

//webform control 
string sPath = Request.Url.GetLeftPart(UriPartial.Authority);
string sResult = HierarchyWeb1.hpcData.LoadFromXmlFile( sPath + "/sample.xml" );
//winform control 
string sResult = hierarchyWin1.hpcData.LoadFromXmlFile( Application.StartupPath + "\\sample.xml");

XML Format:
 <?xml version='1.0' encoding='utf-16'?> 
   <settings PhotoPath='' PhotoSpecification='UsePhoto_ImageList4Levels' /> 
     <item text='Everything is Hierarchical' url='#idEisH'> 
       <item text='What is hierarchy?' url='#idWhat'> 
         <item text='Structure' url='#idStruct'/> 
         <item text='Organization' url='#idOrgn'/> 
         <item text='Classification' url='#idClass'/> 
       <item text='Why hierarchy is important?' url='#idWhy'> 
         <item text='Intention' url='#idInt'/> 
         <item text='Knowledge' url='#idKnow'/> 
       <item text='Which hierarchy matters?' url='#idWhich'> 
         <item text='Stress' url='#idStress'/> 
         <item text='Point of View' url='#idPOV'/> 
       <item text='Whether level matters?' url='#idWhether'/> 
       <item text='When to use?' url='#idWhen'> 
         <item text='Analyse' url='#idAna'/> 
         <item text='Modify' url='#idMod'/> 
       <item text='Who to assign?' url='#idWho'> 
         <item text='Sub-expert' url='#idExpert'/> 
       <item text='How to describe?' url='#idHow'> 
         <item text='Table of Contents' url='#idTable'/> 
         <item text='Hierarchy-Chart\nImpression\nBird`s-Eye View\nTotality\nAccessibilty' url='#idHC'> 
           <item text='Static diagrammming /Drawing' url='#idHCs'/> 
           <item text='Dynamic programming' url='#idHCd'/> 
       <item text='What to do?' url='#idWhatTo'/> 
See Also