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

IsSelected not updating when selecting rows outside the screen

2 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 05 Jun 2013, 04:04 PM
I use this trick to successfully update the IsSelected property of my rows' viewmodels:
<Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}">
                <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
            </Style>

SelectionMode is set to Extended. My RadGridView contains some 1000 rows. I do the following:
1) Select the first row.
2) Scroll down to the last row.
3) Press Shift and select the last row.

All rows are selected, but the IsSelected property is updated only on visible rows (around 20)! What am I doing wrong?

Please help! This bug is crucial in our software!

2 Answers, 1 is accepted

Sort by
0
Kristoffer
Top achievements
Rank 1
answered on 07 Jun 2013, 07:58 AM
Solved it using the SelectionChanged event, but I don't like it :)

private void radGridView_SelectionChanged(object sender, SelectionChangeEventArgs e)
{
    e.AddedItems.OfType<ParticleViewModel>().ToList().ForEach(p => p.IsSelected = true);
    e.RemovedItems.OfType<ParticleViewModel>().ToList().ForEach(p => p.IsSelected = false);
}
0
Nick
Telerik team
answered on 10 Jun 2013, 08:10 AM
Hello Kristoffer,

Unfortunately, this is the way to do it. The Virtualization of the GridView gives a lot in a performance point of view, but introduces some limitations, like the one you get. We are constantly improving our controls, and we will consider adding a mechanism that can enable the IsSelectedBinding, but we cannot commit to a certain time frame. 

We are sorry for any inconvenience caused! Thank you for understanding! 

Regards,
Nik
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Kristoffer
Top achievements
Rank 1
Nick
Telerik team
Share this question
or