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

Binding IsSelected with virtualization

1 Answer 115 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 30 Sep 2011, 04:18 PM
Hi,

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}"/>
 
</Style>

Thanks,
   Bob

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 03 Oct 2011, 06:49 AM
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.
 

Greetings,
Maya
the Telerik team

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

Tags
TreeListView
Asked by
Bob
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or