I have two FilterConditions that I build and apply to the grid on the fly based on input from the user. I do this because I only want them to be able to filter on two columns (out of 6), and I'd rather not display the whole filter row for just two columns.
The filtering works great. The only snag is that when a row is filtered out as a result of applying these filters, the FilterRow event is not fired. I need to be able to catch the FilterRow event and do some things with the row that was filtered out so that my form displays correctly, so I can't just use the Before/AfterRowFilterChanged events since they don't have references the individual rows that were filtered out.
Can I force the event to be fired? Or else, is there another way to determine when a row is filtered out?
I looked at the UltraGrid code and it does in fact look like the event is only fired when the filter criteria is changed via the user interface, which doesn't seem correct, however, it is possible there is some reason for this that escapes me.
One possible solution for this might be to set the FilterUIType to 'HeaderIcons' (i.e., instead of 'FilterRow'), so that no filter row is displayed. This will show icons on the column headers which when clicked will show the row filtering dialog.
I'm afraid that won't work for my solution because I am recreating an old program on a new infrastructure, and the UI needs to conform to the old standard. I appreciate the reply, though, and If you happen to think of any other possible solutions I would greatly appreciate it.
Thanks!
I found a workaround. I set the FilterUIType to FilterRow, but used a Creation Filter to set the FilterRow's Hidden property to true before it is drawn. Then I changed my code to set the value of the FilterRow cell associated with the appropriate column instead of adding a filter condition. After that, all I had to do was call the FilterRow's ApplyFilters() method to filter the rows. This has the desired affect. Chalk another one up to Infragistics extensibility!
Thanks guys!