selected row get unselected when scroll

2 posts, 0 answers
  1. RSquired
    RSquired avatar
    12 posts
    Member since:
    Apr 2012

    Posted 02 Aug 2015 Link to this post

    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.

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 03 Aug 2015 Link to this post

    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
  3. DevCraft banner
Back to Top