Bug: Crash when setting IsVirtualization in a style setter

2 posts, 0 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 14 Nov 2012 Link to this post

    The following xaml crashes with the message "The property 'IsVirtualizing' was not found in type 'Telerik.Windows.Controls.RadTreeView'. [Line: 15 Position: 30]"

    If I comment out the style setter and put IsVirtualizing="True" directly on the treeview it works fine.

    I am using the latest internal build (RadControls_for_Silverlight_5_2012_3_1112_DEV_hotfix).

    <UserControl x:Class="TelerikTestProject01.MainPage_TreeView"
            <Style x:Key="RadTreeViewStyle"
                <Setter Property="IsVirtualizing"
        <Grid x:Name="LayoutRoot">
            <telerik:RadTreeView x:Name="RadTreeView1"
                               Style="{StaticResource RadTreeViewStyle}"></telerik:RadTreeView>
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1182 posts

    Posted 16 Nov 2012 Link to this post

    Hi Henrik,

    You can only set a DependencyProperty using a Style.Setter. However, in the implementation of the RadTreeView, the IsVirtualizing property is defined as a simple boolean object which internally sets the TreeViewPanel.IsVirtualizing DependencyProperty. This is why if you need to control the virtualizaiton  feature through a style, you need to set the  of the TreeViewPanel.IsVirtualizing property as shown in the following snippet:
    Grid x:Name="LayoutRoot">
            <Style x:Key="RadTreeViewStyle" TargetType="telerik:RadTreeView">
                <Setter Property="telerik:TreeViewPanel.IsVirtualizing" Value="True"/>
        <telerik:RadTreeView x:Name="RadTreeView1" Style="{StaticResource RadTreeViewStyle}" />

    Let me know if you have any other questions.

    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top