We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FilterBar filter overwrites DefaultView''s RowFilter

I have a grid bound to a DataTable having a specific filter defined on the DefaultView. The grid is having a FilterBar on top. If I now change the filter using the FilterBar my existing filter will be overwritten. Is there a chance to reapply my specific filter in conjunction with the FilterBar filter? Or, is there an event firing when the filter is changed by the FilterBar? Any advice would greatly be appreciated. Thanks in advance. Regards, Alex

4 Replies

AD Administrator Syncfusion Team October 28, 2004 07:14 AM UTC

What version of our library are you using? 2.1.0.9 will allow you to use a DataView with its RowFilter property set as a datasource for the grid. But if you want to change the DataView.RowFilter after the filterbar has been wired, you will have to unwire the filterbar, change the DataView.RowFilter, and then rewire it.


AD Administrator Syncfusion Team October 28, 2004 10:10 AM UTC

We are using 2.1.0.9. So as far as I can see, we cannot reapply our filter after the filterbar has set its filter. Isn''t there a possibility like an event firing giving me a point to concatenate my filter with the filter generated by the filterbar? Regards, Alex


AD Administrator Syncfusion Team October 28, 2004 12:20 PM UTC

>>So as far as I can see, we cannot reapply our filter after the filterbar has set its filter. If you set this.grid.DataSource = this.dataView1 where already has your filter is already set when you call filterBar.WireGrid, then you should not have to reapply it. It should be maintained by the FilterBar. But if you do want to do it this way, then you can try to use the filterBar.RowFilterChanged event to set it. Here is a little sample. It maintains the filter [col1] > 4 even as you use the filter bar to apply other filters. FilterBarDataView_2503.zip Here is another sample you might be interested in. It sows how you can save filter across wiring and unwiring the grid which you may want to do if you reload data in your grid. Here is a sample showing one way you can persist filters through UnWire/Wire calls. FilterBarSample_6054.zip


AB Alex Brunner October 29, 2004 04:22 AM UTC

Hi Clay This solved my problem. Thanks a lot for your support. Regards, Alex >>>So as far as I can see, we cannot reapply our filter after the filterbar has set its filter. > >If you set this.grid.DataSource = this.dataView1 where already has your filter is already set when you call filterBar.WireGrid, then you should not have to reapply it. It should be maintained by the FilterBar. > >But if you do want to do it this way, then you can try to use the filterBar.RowFilterChanged event to set it. Here is a little sample. It maintains the filter [col1] > 4 even as you use the filter bar to apply other filters. > >FilterBarDataView_2503.zip > >Here is another sample you might be interested in. It sows how you can save filter across wiring and unwiring the grid which you may want to do if you reload data in your grid. > >Here is a sample showing one way you can persist filters through UnWire/Wire calls. > >FilterBarSample_6054.zip > > > >

Loader.
Live Chat Icon For mobile
Up arrow icon