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.
Unfortunately, activation email could not send to your email. Please try again.

Toggle between FilterBar and regular Filters in GridDataControl columns

Thread ID:

Created:

Updated:

Platform:

Replies:

121931 Feb 9,2016 11:43 AM Feb 15,2016 10:51 PM WPF 7
loading
Tags: GridDataControl
Steve McWilliams
Asked On February 9, 2016 11:43 AM

I have a checkbox intended to switch between using the FilterBar and the regular funnel filters in my grid.
It is working when it comes up initially (with the FilterBar) and when I first switch back to regular filters.
But when I check the box again to show FilterBar, it quits working correctly.
The UI always changes to show the right thing, bar or funnels, but the filter text I type in doesn't do anything anymore.

The XAML is like this:
   <syncfusion:GridDataControl  x:Name="runDataGrid"  
                AllowEdit="False"
                AutoPopulateColumns="False"
                AutoPopulateRelations="False"
                ColumnSizer="Auto"
                AllowDelete="False"
                EnableContextMenu="False"
                IsDynamicItemsSource="True"
                EnableTriStateSorting="True" 
                NotifyPropertyChanges="True"
                ShowAddNewRow="False"
                ShowTooltips="True"
                ShowFilters="True"
                ShowFilterBar="{Binding IsChecked,
                               ElementName=ShowFilterBar,
                               Mode=TwoWay,
                               UpdateSourceTrigger=PropertyChanged}"

                ShowFilterStatusMessage="{Binding IsChecked,
                                          ElementName=ShowMessage,
                                          Mode=OneWay,
                                          UpdateSourceTrigger=PropertyChanged}"

                UpdateMode="PropertyChanged"

.............. ....
                        <CheckBox x:Name="ShowFilterBar"
                                  Margin="5"
                                  IsChecked="True">
                            Show Filter Bar
                        </CheckBox>
                   
I implemented event handlers for checked / unchecked events, but I'm not sure what they need to do to reset the filter handling.

        void ShowFilterBar_Checked(object sender, RoutedEventArgs e)
        {
            ClearFilters();
            runDataGrid.ShowFilterBar = true;
        }


Sowndaiyan Paulpandi [Syncfusion]
Replied On February 10, 2016 05:49 AM

Hi Steve,

Thanks for contacting Syncfusion Support.

In GridDataControl you can clear filter collection by using the GridDataVisibleColumn.
Filters.Clear method like the below code example,


C#


        foreach(var column in this.dataGrid.VisibleColumns)

            {

                column.Filters.Clear();

            }



We have prepared
a sample for switch the FilterBar and the regular funnel filters using the CheckBox and you can download the same from the below location. In this sample filtering is working fine from our side. If this solution does not meet your requirement could you please share the exact requirement of GridDataControl filtering in your application. It will be helpful for us to analyze further. 

Sample : http://www.syncfusion.com/downloads/support/forum/121931/ze/FilterBar_Demo1416789228


Please r
efer the below UG link for know more about the Filtering


UG Link :
http://help.syncfusion.com/wpf/griddata/data-presentation#filters-collection

Regards,

Sowndaiyan


Steve McWilliams
Replied On February 10, 2016 09:59 AM

OK, your sample has the same problem as my project does.

To reproduce it, let's use the State Name column. 
First, pick Alabama from the drop-down list on the filter bar; this should filter the list to Alabama records only.
Then, go back to All states.
Now, uncheck the Show Filter Bar checkbox.
Select  the Alabama checkbox in the drop-down list; again, it should filter correctly and show Alabama records.
Now check Select All box again, and full list of records should be shown.

But, if you check the Show Filter Bar box again, although the view switches to display the filter bar, picking something from the drop-down list does not filter anything, neither does typing something like 'A%' in the filter bar header box.


Sowndaiyan Paulpandi [Syncfusion]
Replied On February 11, 2016 06:23 AM

Hi Steve,

We have checked your reported issue with our sample. But we were unable to reproduce the issue. Filtering operations is working fine when we switch the FilterBar and regular filters. For your reference, we have attached the tested video in the below location. Could you please revert by modifying the previous updated sample based on your application and share the details about which Syncfusion Version you have used in your application. It will be helpful for us to analyze further. 

Video :  http://www.syncfusion.com/downloads/support/forum/121931/ze/Filter-1568422022


Regards,

Sowndaiyan.


Steve McWilliams
Replied On February 11, 2016 05:01 PM

I modified my project a little to be as close to yours as possible, but I still get same behavior.

I attached a video of how your example behaves for me (apologies for trial version overlay).
The second time I use the filter bar it no longer filters the data, although the filter status message indicates the correct thing.

I use VisualStudio 2013, but I have an older version of Syncfusion (Essential Studio 10.3.0.43 ), which is probably the problem.

Attachment: ScreenCaptureProject1_e86fd251.7z

Sowndaiyan Paulpandi [Syncfusion]
Replied On February 12, 2016 04:07 AM

Hi Steve,


We were able to reproduce your reported  “Filtering operations” issue in Version 10.3.0.43. We have already fixed this issue and this fix was included in our 13.4.0.53 version. So we recommend you to upgrade to the latest version to get the issue fixed.


Regards,

Sowndaiyan


Steve McWilliams
Replied On February 12, 2016 11:08 AM

Thanks. I will see if I can do that.

Sowndaiyan Paulpandi [Syncfusion]
Replied On February 15, 2016 10:51 PM

Hi Steve,

Thanks for the update.

Please let us know if you need further assistance.
Regards,
Sowndaiyan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;