Welcome to the Xceed Community | Help
Community Search  
More Search Options

DataGridCommands.ClearFilter not clearing FilterRow Cells

Sort Posts: Previous Next
  •  11-30-2009, 5:54 PM Post no. 25035

    DataGridCommands.ClearFilter not clearing FilterRow Cells

    I have a FilterRow in my datagrid.  I also have a button on my page to clear the filters.

    The button simply executes DataGridCommands.ClearFilter with a target of my datagrid.  So, it should clear all filters.

    The filters seem to be cleared,  i.e. the grid shows more data rows.  But, the FilterRow still shows the filter expression for each column that had an expression before executing ClearFilter.  If I click the ClearFilter Button in a giving FilterRow cell, the expression is cleared.

    A similar problem occurs if I set the FilterCriterion on a DataGridCollectionViewSource ItemProperty at runtime.  The proper filter seems to be in effect, but the FilterRow does not have the proper expression. 

    How can I get the FilterRow cells in sync with the actual filter state?

    Here is how I defined my FilterRow, nothing special.

    <xcdg:TableView.FixedHeaders>
         <DataTemplate>
              <xcdg:FilterRow Background="Pink" />
         </DataTemplate>
    </xcdg:TableView.FixedHeaders>

    Here is how I am executing ClearFilter, where _projectsGrid is my DataGridControl

    private void ResetGrid()
    {
         DataGridCommands.ClearFilter.Execute(null, _projectsGrid);
    }

  •  12-03-2009, 8:04 AM Post no. 25073 in reply to 25035

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    Hello,

    Try out this way:

    if (dgcv != null && dgcv.AutoFilterValues.ContainsKey("Selection"))

    {

    dgcv.AutoFilterValues["Selection"].Clear();

    }

    wheer dgcv is Xceed DataGrid.

    You can clear out the Xceed Data Grid filter (Excel like filtering) 

    You can iterate through the AutoFilterValues and can clear each if there is no other way.

    Thanks,

    Paras Sanghani

     

     


    Nothing Is Impossible
  •  12-07-2009, 3:51 PM Post no. 25103 in reply to 25035

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    Hi,

     the ClearFilter command forces the FilterCriterion to become null on every DataGridItemProperty. The Binding used to display the FilterCriterion does not seem to be updated when this occurs. This is a bug in the DataGridControl and I enter a bug report for this. The only way to get the correct behavior is to call the ClearFilter command directly on each FilterCell.

    We'll keep you updated on the availablility of the fix on this thread.

    Thanks for reporting this issue.


    Christian Nadeau
    Software Developer
    Xceed Software Inc.
  •  02-02-2010, 7:27 PM Post no. 25635 in reply to 25103

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    Has this issue been corrected in v3.5?

    None of the following would clear the contents displayed in the FilterRow.  Each of the techniques below does clear the actual filter.

    // Try to clear all FilterRows in the grid.
    DataGridCommands.ClearFilter.Execute(null, _dataGrid);

    // Try to clear the FilterRow.
    DataGridCommands.ClearFilter.Execute(null, _filterRow);

    // Try to clear the each FilterCell in the FilterRow.
    foreach (Cell cell in _filterRow.Cells)
    {
        DataGridCommands.ClearFilter.Execute(null, cell);
    }
     

    What is the workaround to clear content of the FilterRow after the filter has been cleared?

    Thank.

    Filed under: ,
  •  06-28-2010, 1:04 PM Post no. 27312 in reply to 25635

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    From what I can tell Bryan this has not been resolved in v3.5 because I'm having the same issue.  Xceed, can we get confirmation on this?  When will this bug be fixed?
  •  09-17-2010, 1:28 PM Post no. 28740 in reply to 27312

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    same problem...
    is there a known workaround for version 3.5 or version 3.2 already?

  •  09-17-2010, 2:24 PM Post no. 28741 in reply to 28740

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    This issue was fixed in version 3.6.10159.15470, which was released on March 11, 2010.

    "The FilerCell's filter expression is now properly cleared after receiving the ClearFilter command."

    http://xceed.com/updates

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  02-04-2011, 4:54 PM Post no. 29755 in reply to 28741

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    Hi,

     I am using v4.1 WPF Datagrid getting the same issue is not clean filtercriteria textbox when datefield is wrong format.

    Infact  I have button to clean the all filter criteria. It works properly for other fields and proper date is entered. if the date format is wrong  and it shows validation message and changed the background colour.When trying to clean it doesnot clean the textbox and bckground colour.

    I was trying below code and also used to clean

    1) DataGridCommands.ClearFilter.Execute(null, grid)

    The below code works if date format is correct and clear. if date validation error is there the below code is not working.

    infact prop.FilterCriterion is already null before setting null.

    any solution,please. it urgent

     

    2) DataGridVirtualizingCollectionView source = grid.ItemsSource as DataGridVirtualizingCollectionView;

    if (source != null)

    {

    foreach (DataGridItemPropertyBase prop in source.ItemProperties)

    {

       try

         {

          prop.FilterCriterion = null; // infact prop.FilterCriterion

           }

    catch { }

    }

    }

     

     

     

     

  •  06-08-2011, 1:01 PM Post no. 30519 in reply to 29755

    Re: DataGridCommands.ClearFilter not clearing FilterRow Cells

    I can't get this to work using either the ClearFilter command or by setting the FilterCriterions to null.

     private void OnClearFilter(object sender, RoutedEventArgs e) {

        DataGridCommands.ClearFilter.Execute(null, uxDataGrid);
     
        var view = ((DataGridCollectionViewSource)this.FindResource("cvsHubAssemblies"));
        foreach (var itemProperty in view.ItemProperties) {
            itemProperty.FilterCriterion = null;
        }
    }
    

    The first time this method is called, the grid flashes (seems to refresh).  But the filters are still not applied.  Only by manually clearing each column's filter via the column header's Clear Filter button am I able to clear the filtering.  Using v4.2.

    Is this a bug or have I misunderstood how the filter-clearing functionality is intended to work?

    Thanks! 

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.