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

Strange behaviour on vertical scrolling

2 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Roy Halvorsen
Top achievements
Rank 1
Roy Halvorsen asked on 08 Jan 2010, 11:45 AM
I have a gridview, using version 2009.3.1208.35 and MVVM. Style and visibility is applied like the following:
        <telerik:RadGridView.Resources> 
            <Style TargetType="{x:Type GridView:GridViewRow}"
                <Setter Property="Background" Value="#FFFFe1" /> 
                <Style.Triggers> 
                    <DataTrigger Binding="{Binding Path=OperationId}" Value="0"
                        <DataTrigger.Setters> 
                            <Setter Property="Background" Value="#FFFFFF" /> 
                        </DataTrigger.Setters> 
                    </DataTrigger> 
                    <DataTrigger Binding="{Binding Path=OperationStatus}" Value="9"
                        <DataTrigger.Setters> 
                            <Setter Property="Visibility" Value="Collapsed" /> 
                        </DataTrigger.Setters> 
                    </DataTrigger> 
                </Style.Triggers> 
            </Style> 
        </telerik:RadGridView.Resources> 
 
Everything looks fine when the grid is loaded, but, if I scroll vertically, it seems like <Setter Property="Visibility" Value="Collapsed" /> doesn't work anymore. No more rows are collapsed. Is this is a bug, or am I missing something?

Roy

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 08 Jan 2010, 01:34 PM
Hello Roy,

I suggest you to use a bit different approach to exclude some items. Here is an example:

        <telerik:RadGridView ItemsSource="{Binding}">
            <telerik:RadGridView.FilterDescriptors>
                <telerik:FilterDescriptor Member="OperationStatus" Operator="IsNotEqualTo" Value="9" />
            </telerik:RadGridView.FilterDescriptors>
            <telerik:RadGridView.Resources>
                <Style TargetType="{x:Type telerik:GridViewRow}">
                    <Setter Property="Background" Value="#FFFFe1" />
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=OperationId}" Value="0">
                            <DataTrigger.Setters>
                                <Setter Property="Background" Value="#FFFFFF" />
                            </DataTrigger.Setters>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </telerik:RadGridView.Resources>
        </telerik:RadGridView>

Rows visibility is one of the keys behind the grid virtualization and that is why will not work in such scenarios.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Roy Halvorsen
Top achievements
Rank 1
answered on 08 Jan 2010, 01:50 PM
Thanks a lot :-) It works.
Tags
GridView
Asked by
Roy Halvorsen
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Roy Halvorsen
Top achievements
Rank 1
Share this question
or