Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Custom Filter List doesnt work.

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Custom Filter List doesnt work.
Link Posted: 27-Sep-2007 05:44
In two words, you should create child class from FlyGrid and override the GetFilter() method to return custom IFilter object.

You need to create your own class implementing IFilter interface.
Actually it contains the only FilterNodes() method. You need to mark all filtered nodes by setting node.Filtered to true.

Anyway, I think intermediate datatable is the most appropiate way.
It does not seem to bring a lot of changes to code. And serves as an adapter between your data and FlyGrid.
Link Posted: 28-Sep-2007 05:03
Ok. I could manage to implement the thing but filtering itself is a hell of work...

I just have realised that some filtering is working. For instance - when I use basic filtering (by FlyGrid) on DateColumn say [colDateTime] = #05/30/2007 10:56:08# it works. If I set filter string to something more complex like [colDateTime] >= #05/30/2007 00:00:00# AND ([colDateTime] < #05/31/2007 00:00:00#) it stops.

I think it must be fairly simple to fix just that - filtering datetime column with BETWEEN predicate.

I think it could be done in days and it is better than trying to make ultimate solution for everything which is going to happen almost certainly never.

Please let me know if you can consider the quick fix?
Link Posted: 28-Sep-2007 22:36
Hm, I have your filter (exactly) working.

With the following data:

DataTable data = new DataTable();
data.Columns.Add(\"colDateTime\", typeof(DateTime));
data.Rows.Add(new DateTime(2007, 12, 12));
data.Rows.Add(new DateTime(2005, 12, 12));
data.Rows.Add(new DateTime(1995, 12, 12));
data.Rows.Add(new DateTime(2007, 05, 30, 2, 20, 30));

flyGrid1.Rows.DataSource = data;


Then what I have:



Then



Then



Then


(what expected)
Link Posted: 30-Sep-2007 22:45
Sorry Evgeny but you forgot we are talking about unbound grid all the time.

DataTable bound grid is not an option in my project. thats it.

What I said in previous message is - custom filtering on unbound grid works only if filter by predicate '='... My question was - can you make quick fix specifically for dateTime columns to be filtered Between dates (because it has great sence and will let me off hook)

Thank you
Link Posted: 01-Oct-2007 20:06
There cannot be quick fix. All we have is ADO filtering or custom filtering with overriding FlyGrid.GetFilter.