Filtering only selected rows on load

2 posts, 0 answers
  1. Swarna
    Swarna avatar
    1 posts
    Member since:
    May 2014

    Posted 17 Jul 2014 Link to this post

    I have a grid view
    <telerik:RadGridView x:Name="SizingGridView" 
                    ItemsSource="{Binding Model.SizingUpchargeModels}"
                    Style="{StaticResource BaseGrid}"
                    ColumnWidth="*" >
                        <telerik:GridViewCheckBoxColumn IsSortable="False" Header="Selected" DataMemberBinding="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" EditTriggers="CellClick" AutoSelectOnEdit="True"/><telerik:GridViewDataColumn Header="Size" IsReadOnly="True" DataMemberBinding="{Binding Size}" IsSortable="False" />
                        <telerik:GridViewDataColumn Header="Upcharge" DataFormatString="C3" 
                                                DataMemberBinding="{Binding UpchargeAmount, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=False, TargetNullValue={x:Static sys:String.Empty}}"
                                                Style="{StaticResource GridErrorDisplay}" EditTriggers="CellClick" IsSortable="False" >
                                    <commonControls:RadGridMaskedNumericInput Style="{StaticResource GridThreeDecimalAmountTwoDigitsNumericTextEntry}"  IsReadOnly="{Binding Selected,Converter={StaticResource InverseBooleanConverter}}"
                                    Value="{Binding Path=UpchargeAmount, TargetNullValue={x:Static sys:String.Empty}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=False}"/>
    I need to display only show rows Selected = true on initial load. When I click the filter option it should have the checkbox next to true selected. Now the user can unselect true/ select false or clear filter etc.
    How can I achieve this? 

  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 18 Jul 2014 Link to this post


    You should apply the filtering criteria initially through specifying a IColumnFilterDescriptor. That way once you open the FilteringControl, you will have information on the criteria currently applied. 

    Please check our online documentation on Programmatic Filtering for more information on the matter. You can also find an example on the WPF Demos.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top