telerik: containerBindingCollection

9 posts, 0 answers
  1. alino
    alino avatar
    22 posts
    Member since:
    Sep 2010

    Posted 22 Oct 2010 Link to this post

    Hi,

    I want to know the equivalent mecanism in WPF to bind Property  of the TreeView and TreeViewItems with properties in the ViewModel using MVVM pattern. For Example in silverlight  I do such and work perfectly:

    <telerik:ContainerBindingCollection x:Name="BindingProperties">
       <telerik:ContainerBinding PropertyName="IsLoadOnDemandEnabled" Binding="{Binding Path=Expand, Mode=TwoWay}" />
     <telerik:ContainerBinding PropertyName="IsDropAllowed" Binding="{Binding Path=DropAllowed, Mode=TwoWay}"/>
    </telerik:ContainerBindingCollection>

    But this one doesn t work in WPF. Can U tell me how to adapt this in the WPF context??

    Thank U for your Help

    Alino
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Oct 2010 Link to this post

    Hi alino,

    The ContainerBindingColelction is available only in Silverlight, since in WPF you can bind properties in Style. So in your case you can try this:
    <telerik:RadTreeView x:Name="radTreeView" >
        <telerik:RadTreeView.ItemContainerStyle>
            <Style TargetType="telerik:RadTreeViewItem">
                <Setter Property="IsLoadOnDemandEnabled"
                    Value="{Binding Path=Expand, Mode=TwoWay}" />
                <Setter Property="IsDropAllowed"
                    Value="{Binding Path=DropAllowed, Mode=TwoWay}" />
                    </Style>
        </telerik:RadTreeView.ItemContainerStyle>
    </telerik:RadTreeView>
    Give it a try and let us know if you need more info.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. alino
    alino avatar
    22 posts
    Member since:
    Sep 2010

    Posted 27 Oct 2010 Link to this post

    Hi Tina,

    Thank U for your Help, now it s working

    Best regards;

    Alino
  5. senthil
    senthil avatar
    5 posts
    Member since:
    Feb 2011

    Posted 10 Feb 2011 Link to this post

    Hi Tina

    I am Facing Same Problem

    Iam Using  Rad Treeview Custome control it contains style Everthing So  I could not give ItemContainerStyle in Consume Page Once I give ItemContainerStyle That will Affect my own style

    Just I drag and drop it

    Then Create a Node with Check box but Check box is not Selected

    This is our Consume Page Xaml

    <local:

    TreeView x:Name="RadTreeView1" ToolTip="Enter Name" Height="500" Width="300" ItemsOptionListType="CheckList" IsOptionElementsEnabled="True" > </local:TreeView>

    Please help me

    Regards
    SenthilNathan.S
  6. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Feb 2011 Link to this post

    Hi senthil,

    I am not sure how exactly your local:TreeView control is defined and therefore I cannot be sure what is causing you issue but if the RadTreeView is databound, basically you can bind the CheckState property of the RadTreeViewItem using a StyleBinding, like explained here.

    Since the ItemContainerStyle property defines a style for the RadTreeViewItems of a databound RadTreeView, you need to set this proeprty to a style with target type RadTreeViewItem. And if you have already defined such a style, for example RadTreeViewItemStyle, you can set the ItemContainerStyle to: ItemContainerStyle={StaticResource RadTreeViewItemStyle} and modify the RadTreeViewItemStyle to define a binding for the CheckState property of the items.

    I hope this info will help you. Let us know if we can further assist you.

    Best wishes,
    Tina Stancheva
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  7. Mike
    Mike avatar
    2 posts
    Member since:
    May 2011

    Posted 16 Aug 2011 Link to this post

    I’m working with RadTileView and using RadFluidContentControl to handle three different templates based 
    on the TileViewItem state. The solution is C# WPF MVVM Prism.
    I have looked at 279380_Example solution you provided for MVVM which is using Silverlight  
    Telerik ContainerBindingCollection  which does not work in WPF.
     
    Is there any sample project that show this functionality in WPF? I’m looking to do something similar 
    to the TileView Demo with the flags where in the minimized template I have a short description but
    when a TileViewItem is maximized display a detailed information.
     
    Thank you. 
  8. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 19 Aug 2011 Link to this post

    Hi Mike,
    Could you please examine the attached project and if you have more questions feel free to ask?

    Greetings,
    Zarko
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  9. Michael Gaigg
    Michael Gaigg avatar
    9 posts
    Member since:
    Dec 2009

    Posted 21 Nov 2011 Link to this post

    you probably want to update the WPF sample code that you ship with Q3

    in FirstLook example.xaml of treeview

            <Style TargetType="telerik:RadTreeViewItem">
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="IsExpanded" Value="{Binding IsActive}" />
                <Setter Property="IsSelected" Value="{Binding IsActive}" />
            </Style>

    isExpanded and IsSelected are missing - still having the containerBindingCollection in there (the online sample is ok)
  10. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Nov 2011 Link to this post

    Hello Michael,

    Thank you for bringing this issue to our attention. We will remove the ContainerBinding definitions from the WPF solution.

    I updated your Telerik account for this report.

    Best wishes,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready