Unifosys Business Engineering Support
October 15, 2018 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: March 11, 2015: Chart4.NET 2015 (5.1) supports large organization charts, PDF Rendering (Desktop/ASP.NET), 3D, Planer views, Navigational Tree and Data Search:
http://unifosys.com/support/index.php?topic=105.0
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Chart4.NET Organization Chart Component - WPF/Silverlight Usage  (Read 3695 times)
Admin
Administrator
Newbie
*****
Posts: 7



WWW
« on: March 11, 2013 »

WPF Usage

You can use the organization chart winform control (HierarchyWin) in a WPF application, by using WindowsFormsHost - http://msdn.microsoft.com/en-us/library/bb514615.aspx.
Since this is a licensed component, here is the proceedure to insert the license:

1) Create a WPF application.
2) Right-clicking the project in solution Explorer; Add a UserControl (winform, not WPF).
3) Add the HierarchyWin control to the toolbox (how to is here - http://unifosys.com/hierarchy-chart/How-to-Use-Custom-Controls-in-Winforms-and-ASP.NET-Webforms-CSharp-and-VB.NET.html).
4) Drag and drop the HierarchyWin control to userControl (winform). You can do any of chart customizations/events/public interfaces there.
5) Compile the project.
6) Add a reference to the same WPF application (eg:WpfApplication1.exe) in References.
7) Also add a reference to WindowsFormsIntegration (in Framework assemblies).
7) Add the following 2 pieces of code in MainWindow.xaml (or in your page) as described in WindowsFormsHost link above. ie,

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:hc="clr-namespace:WpfApplication1;assembly=WpfApplication1"
        Title="MainWindow" Height="658.956" Width="719.029">
    <Grid Margin="0,0,-31,-30">
       <WindowsFormsHost Height="355" Width="576" Margin="63,125,251,934">
            <hc:UserControl1/>
        </WindowsFormsHost>

    </Grid>
</Window>

Cool Now add the UserControl (winform) from the toolbox to the WPF window (MainWindow.xaml)
9) Run the project and it is done.

NOTE 1: A basic visual studio 2012 sample (usage only) can be downloaded from here: http://unifosys.com/hierarchy-chart/samples.html

NOTE 2: You can add a winform to a WPF application and can use the winform control as usual (same as to a Windows Application).

Silverlight Usage

You can use the organization chart webform control (HierarchyWeb) along with silverlight controls, but have to put the HierarchyWeb control on an aspx page (may be along with silverlight controls) within a web application.
« Last Edit: March 12, 2013 by Admin » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
© 2013 www.unifosys.com