Date Filters in C1FlexGrid

Posted by: cnickerson on 12 September 2025, 10:17 am EST

  • Posted 12 September 2025, 10:17 am EST

    Hello,

    I am trying to set up a C1FlexGrid in WPF 4.6.2 2024v1(839). My grid will have both a Full Text Filter and the FlexGridFilter. The questions I have are around my Date field.

    1. In the FlexGridFilter, is it possible to sort the filter list descending? So the latest dates are at the top?
    2. Is there a Filter view that displays the dates as a calendar instead of just listing all of the dates like a string?
    3. How would I filter for a date in the Full Text Filter? Since I’m using MMM-dd-yyyy format, I’d want them to be able to do either “08” or by typing in “Aug” to get August
    <c1:C1TextBoxBase x:Name="Filter" 
                      Margin="4 4 4 4" 
                      VerticalAlignment="Center"
                      HorizontalAlignment="Stretch"
                      Watermark="Search"/>
    
    <c1:C1FlexGrid x:Name="flexGrid" 
        Margin="0"
        AutoGenerateColumns="False"
        IsReadOnly="true"
        GridLinesBrush="Black"
        GridLinesVisibility="All"
        HorizontalAlignment="Stretch"
        HeadersVisibility="Column">
        <c1:C1FlexGridFilterService.FlexGridFilter>
            <c1:C1FlexGridFilter />
        </c1:C1FlexGridFilterService.FlexGridFilter>
        <c1:C1FlexGridFilterService.FullTextFilterBehavior>
            <c1:C1FullTextFilter FilterEntry="{Binding Source={x:Reference Filter}}" 
                                 MatchNumbers="True" />
        </c1:C1FlexGridFilterService.FullTextFilterBehavior>
        <c1:C1FlexGrid.Columns>
            <c1:Column Binding="{Binding ID}" Width="0.55*" HorizontalAlignment="Right" Header="ID"  />
            <c1:Column Binding="{Binding Description}" Width="3*" Header="Description" />
            <c1:Column Binding="{Binding Date}" Width="0.5*" Format="MMM-dd-yyyy" Header="Date" />
            <c1:Column Binding="{Binding Project}" Width=".5*" Header="Project"  />
        </c1:C1FlexGrid.Columns>
    </c1:C1FlexGrid>
  • Posted 15 September 2025, 11:28 am EST

    Hi Chris,

    Thanks for reaching out to us.

    1. The FlexGridFilter itself doesn’t support changing the sort order of the filter list. But you can sort the data shown in the grid by adding a sort description to the collection view, like this:
    (CollectionViewSource.GetDefaultView(flexGrid.ItemsSource) as ICollectionView).SortDescriptions.Add(new SortDescription("Date", ListSortDirection.Descending));

    We have attached a sample application for your reference. FilterDemoGrid.zip

    1. In the .NET Framework version, FlexGrid only provides Value and Condition filters. It doesn’t have a built-in calendar picker in the filter.

      In the .NET 8 version of FlexGrid, you can create custom filters. You can check the View → CustomFilters sample here: https://github.com/GrapeCity/ComponentOne-WPF-Samples/tree/master/NET_9/Grid/FlexGridExplorer

      The View → AdvancedFiltering sample also shows how you can build more advanced filter UIs.

    2. The Full Text Filter works by matching the exact text shown in the grid cells. It does not directly support searching “08” for “Aug.”

      As a workaround, you can add an extra hidden column (width = 0) that contains the month number. This way, users can type either “Aug” (for the month name shown in the Date column) or “08” (for the hidden column) and still filter the rows. Note that the highlight will only match the displayed text, not the hidden one.

    We have also implemented this in the attached sample application.

    Thanks & regards,

    Aastha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels