I am using the "BeforeRowFilterChanged" event to capture the filter condition entered by the user. I then pepare my own db query and execute it as my db table my have a million records. The problem I am having is I am batching x number of records at a time and the offend event of the bindingsource will continue to fire until all the records are retrieved. I am assuming this is because the grid needs to grab all records in order to properly apply the filter. Since I am handling the filter can I tell the grid this besides using e.Cancel to cancel the filter event? If I use e.Cancel then my column filter icon does not show that a filter is current on the column.
Hi Roger,
Unfortunately, the grid doesn't currently have the ability to allow you to do the sort've external filtering you are trying to do to. The UI for the filter icon is tied to the actual filters.
This would probably be a nice feature to add to the grid, though. We have an external mode for sorting, but not filtering. So I encourage you to Submit a feature request to Infragistics.
Mike,
If I set e.cancel = true could I then set the filter icon to display that a filter is applied to the column?
You would have to use a DrawFilter or CreationFilter for this to change the appearance of the filter button image.
You would also have to keep track of the fact that the column is filtered, because as far as the grid is concerned, it would not be.
Is there anyway to know that the UltraGrid is currently performing a filter? For example, we batch anywhere from 200 - 500 records at a time. What is happening is the UltraGrid is forcing the offend event to fire on our bindingsource. It is possible for me to tell that the UltraGrid is currently performing a filter so I can abort the next fetch of data?
I know there are BeforeRowFilterChanged and AfterRowFilterChanged events where I could set some sort of flag but did not know if there were a better way.
Thanks.
You can loop through the ColumnFilters collection on the band and on each one, check FilterConditions.Count. If it is 0 on all columns, then there are no filters applied.