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

    I have a grid defined like this:

        Grid.Row="1" Margin="4"
        ItemsSource="{Binding Results}"
        ScrollMode="RealTime" CanUserInsertRows="False" CanUserDeleteRows="False" EditTriggers="None" IsReadOnly="True">
            <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" />

    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
    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,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. 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}" />
            <Trigger Property="Command" Value="{x:Null}">
                <Setter Property="UIElement.IsEnabled" Value="False" />

    I guess that is likely the culprit?

      // Regards, Morten

Back to Top