Unifosys > Unifosys Support Help Desk > Knowledgebase

Ask a question:

Custom Controls in Organization Chart Control


Custom Controls in Organization Chart Control

Question: How to add custom controls in the Chart4.NET control?


1) Custom ToolStrips and StatusStrip

You can add controls in hpToolStrip4Top, hpToolStrip4Left, and hpStatusStrip properties and can map event handlers to the added controls. Remember to set AvailableOnChart property to true, to diaplay the strips on the chart

Example Usage:
The following example adds a title to the chart in the top toolstrip

        private void frmMain_Load( object sender, System.EventArgs e )
            hierarchyWin1.hpToolStrip4Top.AvailableOnChart = true;
            ToolStripItem tsi = new ToolStripDropDownButton ("Org Chart Hierarchy");//title text here
            tsi.Font = new Font("Tahoma", 14);
            tsi.ForeColor = Color.Teal;        
            //tsi.Click += new EventHandler( tsi_Click );
        //void tsi_Click( object sender, EventArgs e )
        //    //

Similarly you can add other ToolStripItems like:
  • ToolStripButton
  • ToolStripComboBox
  • ToolStripDropDown
  • ToolStripDropDownButton
  • ToolStripDropDownMenu

  • 2) Custom Controls in Chart Nodes

    You can add custom controls to chart nodes. First get the particular node through its assigned name from the hpcData.Nodes collection. Then add the control or container control to the Controls collection.

    Example Usage:
                HierarchyNode hnd1 = hierarchyWin1.hpcData.Nodes["Mike"];
    Was this article helpful? yes / no
    Article details
    Article ID: 13
    Category: Support Questions
    Date added: 22-Jun-2011
    Views: 510
    Rating (Votes): Article rated 3.3/5.0 (7)

    << Go back

    © 2013

    Powered by Help Desk Software HESK™