Giter Club home page Giter Club logo

datagridfilter's Introduction

GitHub release (latest by date)

WPF Filterable DataGrid, multi language

datagrid image demo

A DataGrid control that inherits from the base DataGrid control class and override some methods to implement filters
for each column like Excel, in automatic or custom generation.

Translation of labels and formatting of dates in the following languages: English, French, Russian, German, Italian, Chinese, Dutch.

The translations are from google translate, if you find any errors or want to add other languages, please let me know.

The Nuget package is available here.

To understand how the filter works, you can consult the article posted on CodeProject.

How to use

  • There are two ways to install :

    • NuGet command : Install-Package FilterDataGrid
    • Or manually add FilterDataGrid.dll as reference in your project
  • Add FilterDatagrid into your xaml :

    • Namespace

      <Window xmlns:control="http://filterdatagrid.control.com/2021" ...
    • Control

      <control:FilterDataGrid 
       FilterLanguage="English" DateFormatString="d" ShowStatusBar="True" ShowElapsedTime="False" ...
      • Properties
        • ShowStatusBar : displays the status bar, default : false
        • ShowElapsedTime : displays the elapsed time of filtering in status bar, default : false
        • ShowRowsCount : display the number of rows, default : false
        • DateFormatString : date display format, default : "d"

        You must delete the time or set it to zero in the DateTime field, otherwise the filter does not work.
        see the documentation "Standard date and time format strings"

        • FilterLanguage : translation into available language, default : English

    If you add custom columns, you must set AutoGenerateColumns="False"

    • Custom TextColumn

      <control:FilterDataGrid.Columns>   
          <control:DataGridTextColumn IsColumnFiltered="True" ...
    • Custom TemplateColumn

      FieldName property of DataGridTemplateColumn is required

      <control:FilterDataGrid.Columns>   
          <control:DataGridTemplateColumn IsColumnFiltered="True"
      	                            FieldName="LastName" ...

Global Style

You can define a global style which overrides the default style of "FilterDataGrid"

<Style
            x:Key="FilterDatagridStyle"
            BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly=control:FilterDataGrid,
                                                           ResourceId=FilterDataGridStyle}}"
            TargetType="{x:Type control:FilterDataGrid}">
            <Setter Property="Margin" Value="10" />
            <Setter Property="RowHeaderWidth" Value="40" />
	    ...
</Style>

Benchmark

Intel Core i7, 2.93 GHz, 16 GB, Windows 10, 64 bits.
Tested on the "Last name" column of the demo application using a random distinct name generator, between 5 and 8 letters in length.
The elapsed time decreases based on the number of columns and filtered items.

Number of rows Opening of the PopUp Applying the filter Total (PopUp + Filter)
10 000 < 1 second < 1 second < 1 second
100 000 < 1 second < 1 second < 1 second
500 000 ± 1.5 second ± 1 second ± 2.5 seconds
1 000 000 ± 3 seconds ± 1.5 seconds ± 4.5 seconds

Demonstration

datagrid image demo

Contributors

datagridfilter's People

Contributors

apflkuacha avatar chm40 avatar macgile avatar sh-esterion avatar swh1998 avatar tenera avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.