TreeView WPF + Load on Demand

3 posts, 0 answers
    LAURIO avatar
    18 posts
    Member since:
    Feb 2009

    Posted 20 Feb 2009 Link to this post

    Hi all,

    Excuse for my poor english, i'm a french user. We planned to buy Telerik WPF components to use them in our VS 2008 projects, but i need to check first if they're fully compatible with my actual code.

    I followed an article from Code Project, using theViewModelPattern to feed my treeview. That's ok with the basic treeview from vs 2008, but the basic treeview doesn't implement Drag and drop operations, so i have to test yours. I would like to use your treeview instead of microsoft one but without rewriting my code behind and classes, just by rewriting my xaml.I have tried a lot of thing but i couldn't manage to plug my actual code with your treeview.

    My "classic" code working with microsoft treeview:

      xmlns:local="clr-namespace:XXX.XXX.LoadOnDemand" Background="Transparent"
            <TextBlock DockPanel.Dock="Bottom" TextWrapping="Wrap" FontSize="12"
                <Image Source="/XXX;component/LoadOnDemand/Images/logo.png" Height="120" Width="160"></Image> 
            <TreeView ItemsSource="{Binding Regions}" Background="Transparent" BorderThickness="0" x:Name="MonTreeview"
            This Style binds a TreeViewItem to a TreeViewItemViewModel. 
                    <Style TargetType="{x:Type TreeViewItem}"
                        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> 
                        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 
                        <Setter Property="FontWeight" Value="Normal" /> 
                            <Trigger Property="IsSelected" Value="True"
                                <Setter Property="FontWeight" Value="Bold" /> 
              DataType="{x:Type local:affaireModel}"  
              ItemsSource="{Binding Children}" 
                        <StackPanel Orientation="Horizontal"
                            <Image Width="16" Height="16" Margin="3,0" Source="Images\Region.png" /> 
                            <TextBlock Text="{Binding AffaireName}" /> 
              DataType="{x:Type local:StateViewModel}"  
              ItemsSource="{Binding Children}" 
                        <StackPanel Orientation="Horizontal"
                            <Image Width="16" Height="16" Margin="3,0" Source="Images\State.png" /> 
                            <TextBlock Text="{Binding ChapitreAffaireName}" /> 
                    <DataTemplate DataType="{x:Type local:maTacheModel}"
                        <StackPanel Orientation="Horizontal"
                            <Image Width="16" Height="16" Margin="3,0" Source="Images\City.png" /> 
                            <TextBlock Text="{Binding TacheName}" /> 
            <Label Height="66" Name="Label1" Width="149">Label</Label> 

    Is it possible for me to use your treeview just by rewriting my xaml, without changing any of my classes?

    Thanks for your reply. I've already try the carousel component and the grid view too, i'm fully satisfied.
  2. Ivan
    Ivan avatar
    519 posts

    Posted 21 Feb 2009 Link to this post

    Hello Laurio

    Attached, you can find an example where the "Load on Demand" mechanism is demonstrated.
    Please give it a try and let me know if I can assist you further.

    If you are specifically interested in RadTreeView and especially in the load on demand please check following articles:
    How to Databind RadTreeView in WPF
    Silverlight TreeView Load on Demand
    RadControls for Silverlight Demo with ADO.NET Data Services

    Please note there are some glitches with the Drag&Drop in our last release and we will definitely address them with the upcoming Q1 release due in March.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    LAURIO avatar
    18 posts
    Member since:
    Feb 2009

    Posted 23 Feb 2009 Link to this post


    I'll try this as soon as i can, i'll make you a reply about the issue. Thanks a lot, have a good day

Back to Top