Flexible TreeView Flexible TreeView


Support & Community

Use Flexible TreeView in WPF project

Previous Table of Contents Next

Though Flexible TreeView is a WinForms component, it can be easily used in the WPF project right now by using WinForms controls host facility with the help of WindowsFormsHost class. At the same time all rich Flexible TreeView functionality is available to you as in the WinForms version.

For example, below there is the sample of XAML which creates a treeview with the column and a text node control in it, and also adds the root and child node:

<Window x:Class="FTVWpfTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ftv="clr-namespace:ARMSoft.FlexibleTreeView;assembly=ARMSoft.FlexibleTreeView"
        xmlns:col="clr-namespace:ARMSoft.FlexibleTreeView.Column;assembly=ARMSoft.FlexibleTreeView"
        xmlns:nodectrl="clr-namespace:ARMSoft.FlexibleTreeView.NodeControls;assembly=ARMSoft.FlexibleTreeView"
        xmlns:nodes="clr-namespace:ARMSoft.FlexibleTreeView.Nodes;assembly=ARMSoft.FlexibleTreeView"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <WindowsFormsHost>
            <ftv:FlexibleTreeView x:Name="tree" NodeExpanding="tree_NodeExpanding">
                <ftv:FlexibleTreeView.Columns>
                    <col:TreeColumn Text="test" Id="0" Width="150" />
                </ftv:FlexibleTreeView.Columns>
                
                <ftv:FlexibleTreeView.NodeControls>
                    <nodectrl:NodeTextBox ColumnId="0" DataFieldName="Text" />
                </ftv:FlexibleTreeView.NodeControls>
                
                <ftv:FlexibleTreeView.Nodes>
                    <nodes:Node Text="XAML node">
                        <nodes:Node.Nodes>
                            <nodes:Node Text="XAML sub-node"/>
                        </nodes:Node.Nodes>
                    </nodes:Node>
                </ftv:FlexibleTreeView.Nodes>
 
            </ftv:FlexibleTreeView>
        </WindowsFormsHost>
    </Grid>
</Window>

Please, note that the event handlers (NodeExpanding in the sample above) are added in XAML as easily as for the native WPF control.

At the moment we are working on porting Flexible TreeView to WPF and when the native WPF version is available you will be able to replace the current wrapper with native control by simply deleting some lines in XAML.

Previous Top Next


Last news
Bookmark and Share
Use Flexible TreeView in WPF project
Sunday, 18 December 2011

Do you have a WPF project and want to use Flexible TreeView there? No problem!

Flexible TreeView v3.4
Friday, 16 December 2011

Flexible TreeView v3.4 maintenance release has been released.

Flexible TreeView v3.3
Friday, 23 September 2011

Flexible TreeView v3.3 maintenance release has been released. Separate assemblies for .NET 2.0, 4.0 and 4.0 Client Profile, HTML markup extension, etc.

Latest release

Version:
Release date:
3.4
Dec 16, 2011


Copyright © 2006-2012 ARMSoft. All rights reserved.