This is a migrated thread and some comments may be shown as answers.

Binding RadTreeListView to ModelItem

2 Answers 128 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Arinto
Top achievements
Rank 1
Arinto asked on 24 Feb 2011, 09:47 AM
Hi there, 

We want to use RadTreeListView to bind into Workflow Foundation's ModelItem.
The example shown in this sample code is using TreeView to display WF ModelItem. But in our requirement, we need additional columns to display information in the node. That's why we plan to use RadTreeListView. However, we haven't been able to bind it properly to ModelItem.

So, do you have any idea how to bind ModelItem to RadTreeListView?
Here is the simplified structure of ModelItem that we want to bind
  1. ModelItem has collection of ModelProperty
  2. The Value property of ModelProperty object is another ModelItem
  3. So, we want to bind to ModelItem (let's say MI), and then MI's children will be collection of ModelProperty.Value (which is also a type of ModelItem)

Thanks and best regards, 

Arinto

2 Answers, 1 is accepted

Sort by
0
Arinto
Top achievements
Rank 1
answered on 25 Feb 2011, 07:38 AM
Hi there,

Additional info on ModelItem class. ModelItem can be bound to WPF XAML using its dynamic binding.
Refer to these two links for additional informations:
1. Improving ModelItem with Dynamic
2. Deep Dive into WF Designer Data Model: ModelItem and ModelProperty

So we can use ModelItem properties directly in the XAML.
Example. This example works well for Sequence Activity in Workflow framework
<telerik:RadTreeListView Name="sequenceTreeListView"
                         AutoGenerateColumns="False"
                         SelectionUnit="FullRow"
                         SelectionMode="Single"
                         HierarchyColumnIndex="0"
                         Grid.Row="0"
                         telerik:StyleManager.Theme="Windows7"
                         ItemsSource="{Binding }"
                         >
    <telerik:RadTreeListView.Columns>
        <telerik:GridViewDataColumn Header="Title"
                                    IsFilterable="False"
                                    DataMemberBinding="{Binding Path=ItemType}"/>
    </telerik:RadTreeListView.Columns>
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=Activities, Converter={StaticResource childrenConverter}}"/>
    </telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>


0
Maya
Telerik team
answered on 01 Mar 2011, 05:26 PM
Hi Arinto,

I got a bit confused as it seems that you have already find the right approach for your scenario. May you clarify whether you need any assistance or you have got everything solved ? 
 

Regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TreeListView
Asked by
Arinto
Top achievements
Rank 1
Answers by
Arinto
Top achievements
Rank 1
Maya
Telerik team
Share this question
or