Ciao,
1 – Is it possible to map a filter to the column of a datagrid programmatically? In the example of your guide (https://wisej.com/blog/columnfilter/) it would seem you can only make this association from the interface.
2 –The downloaded example (see attachment) does not work
Grazie,
Alessandro
Ciao,
I have two more questions…
1 – What event should I use to display the number of filtered rows on a label?
2 – How do I see if there is an active filter or not?
Grazie
Alessandro
P.S. You’re doing a great job!
Ciao Messere,
For your first question, it is possible! Any changes you make to properties of controls in the designer are reflected in C# code in InitializeComponent() in the partial Designer.cs class.
You can expand the node of your Window or Page in the Solution Explorer window to see the Designer class.
The ColumnFilter extension uses a Property Extender (See: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.iextenderprovider?view=net-5.0) that allows it to insert properties to objects of a specific type (DataGridViewColumn).
You’ll see the new property in the Designer, but it is not visible using Intellisense.
To apply a filter programmatically, it will look something like this:
this.columnFilter1.SetShowFilter(this.Column1, true);
For the second question, we’ll get that link fixed for you ASAP!
Hope that helps.
Best,
Levie
Please login first to submit.