Unable to clear filter, but set one, when gridview is read only

3 posts, 0 answers
  1. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 03 Jan 2012 Link to this post

    Hello,
    I have a grid defined like this:

    <telerik:RadGridView
        x:Name="resultsList"
        Grid.Row="1" Margin="4"
        ItemsSource="{Binding Results}"
        telerik:Theming.Theme="Windows7"
        ShowGroupPanel="False"
        AutoGenerateColumns="False"
        MouseDoubleClick="resultsList_MouseDoubleClick"
        ScrollMode="RealTime" CanUserInsertRows="False" CanUserDeleteRows="False" EditTriggers="None" IsReadOnly="True">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn Header="One" DataMemberBinding="{Binding Model.Article}" Width="100" />
            <telerik:GridViewDataColumn Header="Two" DataMemberBinding="{Binding Model.Batch}" Width="50" />
            <telerik:GridViewDataColumn Header="Three" DataMemberBinding="{Binding Model.Serial}" Width="120" ShowDistinctFilters="False" />
            <telerik:GridViewDataColumn Header="Four" DataMemberBinding="{Binding UnitDetails.LastOperation.Name}" Width="120" />
            <telerik:GridViewDataColumn Header="Five" DataMemberBinding="{Binding UnitDetails.Opened}" Width="150" ShowDistinctFilters="False" />
            <telerik:GridViewDataColumn Header="Six" DataMemberBinding="{Binding UnitDetails.Completed}" Width="150"  ShowDistinctFilters="False" />
            <telerik:GridViewDataColumn Header="Seven" DataMemberBinding="{Binding UnitDetails.CurrentStatus}" Width="100" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>

    Running the application, I set a filter to some date on the column here named "Six".
    When I then clicked the filter button again, I was unable to clear the filter.
    I suspect it has to do with me setting IsReadonly to true.
    Is this a bug?

      -- Regards, Morten
  2. Vera
    Admin
    Vera avatar
    263 posts

    Posted 05 Jan 2012 Link to this post

    Hi Morten,

     I tried to reproduce the reported issue, but without any success. May I ask you to take a look at the attached project based on the code snippet you provided? Are you able to get the described behavior on it?

    Kind regards,
    Vera
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Morten Nilsen
    Morten Nilsen avatar
    32 posts
    Member since:
    Jun 2010

    Posted 05 Jan 2012 Link to this post

    The sample does indeed seem to work as it should.
    When I open the filter list in my window, the filter/clear filter buttons are both disabled from the start, but in your sample, they are both enabled.

    My WPF theme contains this style:

    <Style TargetType="{x:Type Button}" BasedOn="{x:Null}">
        <Setter Property="FocusVisualStyle" Value="{DynamicResource NuclearButtonFocusVisual}"/>
        <Setter Property="Background" Value="{DynamicResource NormalBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
        <Setter Property="Template" Value="{DynamicResource NuclearButton}" />
        <Style.Triggers>
            <Trigger Property="Command" Value="{x:Null}">
                <Setter Property="UIElement.IsEnabled" Value="False" />
            </Trigger>
        </Style.Triggers>
    </Style>

    I guess that is likely the culprit?

      // Regards, Morten

Back to Top