Binding IsSelected with virtualization

2 posts, 0 answers
  1. Bob
    Bob avatar
    9 posts
    Member since:
    Nov 2010

    Posted 30 Sep 2011 Link to this post


    I've bound my model's IsSelected property to the TreeListViewRow's IsSelected property. The problem is that if I have a long list of items, the user can select the first, then scroll down to the bottom and Shift+Click the last to select them all. But only some of my model objects get their IsSelected flag set. It's mostly just the model objects that are visible. I suspect the problem is caused by virtualization being turned on. There's no TreeListViewRow for most of the items, so their IsSelected flags don't get set.

    So how do I get my IsSelected flag set for virtualized rows?

    My current binding is:
    <Style TargetType="{x:Type telerik:TreeListViewRow">
        <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}"/>

  2. Maya
    Maya avatar
    4062 posts

    Posted 03 Oct 2011 Link to this post

    Hi Bob,

    Indeed, due to the virtualization you will be able to work only with the visible visual items. What I could suggest is to work directly with the data items and bind the SelectedItem property of RadTreeListView.

    the Telerik team

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

Back to Top