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

selected row get unselected when scroll

1 Answer 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
RR
Top achievements
Rank 1
RR asked on 03 Aug 2015, 04:25 AM

I have a grid with a check box column that enable users to see checked when row is selected. 

<Style x:Name="GridViewCheckBoxStyle" TargetType="telerik:GridViewCell">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate>
                <Border>
                    <CheckBox Style="{StaticResource CommonCheckBoxStyle}"
                              IsChecked="{Binding IsSelected,Mode=TwoWay}"
                Checked="ContactSelcted" Unchecked="ContactUnSelcted"
                                  Margin="2,0"  HorizontalAlignment="Center"
                                  />
                </Border>
 
            </ControlTemplate>
        </Setter.Value>
    </Setter>

The problem is when i select one row and scroll up and  the selected row get hidden suddenly Unchecked event is fired. But i dont want it to happen. but then when the selected row get visible again the checkbox is checked "by itself" and thus checked event fired. i want to keep the checked row as it is event if it is not visible. why is this happening and how to solve it?

Thank you in advance.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 03 Aug 2015, 09:48 AM
Hi,

Generally, we do not recommend working with the visual elements in RadGridView (i.e. GridViewCell) as it is a virtualized control and its elements are reused as they are brought in and out the view area. You can also check our online documentation explaining how the UI virtualization works. 
 
I would suggest you to implement your logic when the bound property changes its value.

In case this is not what you need, would you please share some more details on what the desired functionality is?

Regards,
Dimitrina
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
RR
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or