CheckState and IsVirtualizing Problem

12 posts, 0 answers
  1. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 12 Jan 2011 Link to this post

    When trying to use IsVirtualizing we are running into an issue with checkboxes not in the initial view are set incorrectly on data load. We are not binding to IsChecked property but are binding to the CheckState property.

    The following is used to define the RadTreeViewItems:

    <Style TargetType="{x:Type telerikNavigation:RadTreeViewItem}">
        <Setter Property="CheckState" Value="{Binding IsCheckedState, Mode=TwoWay}" />
        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
    </Style>

    The RadTreeView includes the virtualization settings:

    IsVirtualizing="True" 
    telerikTreeView:TreeViewPanel.VirtualizationMode="Hierarchical">

    Does it look like the xaml is wrong?  If not, is there a work-around or a fix for this?

    Without the virtualization, the RadTreeView is unacceptably slow on loading a list of just 7500 root level items.

    Thanks,

    T.
  2. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 13 Jan 2011 Link to this post

    After additional research the main problem is that programmatic changes to a virtualized RadTreeViewItem checkbox CheckState are not triggering the Check/Uncheck events that are tied to the RadTreeView.  Only the ones currently in the view are triggering the event properly.

    T.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 14 Jan 2011 Link to this post

    Since there doesn't seem to be a solution to the Check/Unchecked event not firing for virtualized items -- perhaps I can catch the virtualized items when they come into view (by scrolling) so I can make sure the children checkboxes are set appropriately.  Is there an event that gets triggered when a virtualized RadTreeViewItem comes into the current view?  If there is -- please include a code snippet on how to setup the event.

    Thanks in advance.

    Tracy.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Jan 2011 Link to this post

    Hello Tracy,

    This is a known issue and you can vote for it here. The good news is the elegant workaround that uses Converter to switch from bool? or bool to ToggleState. you can examine it in the attached solution and let me know if it fits in your scenario.

    Regards,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 17 Jan 2011 Link to this post

    Thanks for responding.

    We are using both CheckState and IsChecked in conjunction together, so that doesn't seem to be the issue.

    In the example you sent you are only dealing with one level of items in the treeview which we are not having a problem keeping the root level items in the correct state. We have two levels and it is the child level which we are having issues with keeping the correct state. The TreeView's Checked/Unchecked event allowed us to keep the children in synch with the parents - but virtualization has broken that ability.  We are dealing with upwards of 7500 root level items with 1 to 3 child items each, so we are using virtualization. I don't see that addressed in the example. 

    I really don't want to resort to turning off virtualization since it causes "out of memory" errors and is incredibly cpu intensive when loading the treeview.

    Tracy
  7. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 17 Jan 2011 Link to this post

    When using VirtualizationMode="Hierarchical" the event Loaded gets triggered when scrolling down through the virtualized items.

    When using VirtualizationMode="Recycling" the event Loaded does NOT get triggered when scrolling down to through the virtualized items. IS there an event that gets triggered for this case, so that I know when a virtualized item is now in view?

    Thanks.

    Tracy
  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Jan 2011 Link to this post

    Hello Tracy,

    I modified my solution in order to us 2 levels of hierarchical data. I was unable to reproduce a scenario in which the virtualization brakes the checkstate of a secondlevel Item. Could you please elaborate more on you scenario and especially the steps you do? It would be nice if you can modify the solution so that it shows the problem clearly and we would be able to investigate in depth. On the other hand , do you use Load On demand feature ,since there are some issues related to checkstate and load on demand in conjunction.
    As for the events that fire when a virtualized item is being generated when you scroll down, the method in this scenario is TreeView.ItemPrepared. It fires when the visual containers (RadTreeViewitems) are generated. 
    Additionally, we would highly appreciate if you send us a runnable sample demonstrating the issue. This way we would provide you with a better suited solution faster.  

    All the best,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  9. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 04 Feb 2011 Link to this post

    Sorry, I haven't replied sooner. Been real busy.

    I am unable to open and/or modify the sample project as we are currently developing in VS2008.

    Thanks,

    Tracy
  10. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 08 Feb 2011 Link to this post

    Hi Tracy,

    I am sending you the modified version of the previous project in order to use WPF 3.5, VS 2008 and 2010 Q3 (1110) version of telerik controls. I hope you will be able to modify it in order to show the issue you have come up with. This way we would be able advice you better. Thank you for your cooperation.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  11. Tracy
    Tracy avatar
    29 posts
    Member since:
    Sep 2010

    Posted 31 Mar 2011 Link to this post

    We have been able to take the time in our development cycle to incorporate the new version of your controls.  The update appears to have fixed our issue, as I was able to remove the work-around and it works.

    Thank you,

    Tracy
  12. Aurore
    Aurore avatar
    58 posts
    Member since:
    Nov 2007

    Posted 22 Apr 2011 Link to this post

    Hello,

    I modified your sample to add " IsTriStateMode="True" on the treeview.

    I expand the first item, uncheck it. I see the fisrt "subitems" are uncheked but not all in the sub-item0 nodes !  (scroll to item020 for sample).

    If i remove virtualization, that works as i expect.

    Have you an idea ?

    Thanks
    Aurore
  13. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 Apr 2011 Link to this post

    Hello Tracy,

    This is default behavior of the RadTreeView. The ContainerBindings(SL) / Style Bindings (WPF) are with higher priority than the TriState logic when a RadtreeViewItem is being realized. This happens when you scroll down to a non-realized item and the tree is virtualized or when the tree is not virtualized and you uncheck  a parent and the expand it so that its child items get realized. So currently you will have to implement your TriState logic in the ViewModel.
    You can also vote for this issue here in order to increase its priority.

    Kind regards,
    Petar Mladenov
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready