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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PivotGridControl Filters changed event

Thread ID:

Created:

Updated:

Platform:

Replies:

128972 Feb 19,2017 02:31 PM UTC Feb 21,2017 03:41 PM UTC WinForms 3
loading
Tags: PivotGridControl
Matthijs Huisman
Asked On February 19, 2017 02:31 PM UTC

Hi,

I have a PivotGridControl with a PivotTableFieldList. If the user changes the setup of the Grid and adds a field to the Report Filter, I can catch the change of PivotFilters but NOT the changes in the content of the PivotFilter.

Let's say I have multiple years in a field and the user deselects on of the years (for instance 2014, 2015 but NOT 2016) -> how can I catch that event?

Thanks!

Cheers,

Matthijs

Mohanraj Gunasekaran [Syncfusion]
Replied On February 20, 2017 11:47 AM UTC

Hi Matthijs, 
 
Thanks for using Syncfusion products. 
 
In order to get the filtered value, you can use the Expression property in Filters.CollectionChanged event. Please refer the below code example and refer the below attached sample, 
 
Code example 
AddHandler Me.pivotGridControl1.Filters.CollectionChanged, AddressOf Filters_CollectionChanged 
Private Sub Filters_CollectionChanged(ByVal sender As Object, ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs) 
    If e.NewItems IsNot Nothing AndAlso TypeOf e.NewItems(0) Is FilterExpression Then 
        Dim expression As FilterExpression = TryCast(e.NewItems(0), FilterExpression) 
        Dim filteredvalue() As String = expression.Expression.Split(New String() { "||" }, StringSplitOptions.None) 
        Dim values As String =Nothing 
        For Each value As String In filteredvalue 
             values &= value.Replace(expression.DimensionName, String.Empty).Replace("=", String.Empty)+ Constants.vbCrLf 
        Next value 
    End If 
End Sub 
 
Sample link: PivotGridControl 
 
Please let us know if you have any further assistance. 
 
Regards, 
Mohanraj G. 


Matthijs Huisman
Replied On February 20, 2017 02:12 PM UTC

Hi,

Thank you for your answer, but you helped me already with your other post (id 128966)! The PivotSchemaDesigner.SchemaChanged event was the key -> this event fires when a filter expression is changed as well!

NB: the event you describe here only fires when an expression is added or removed from the filtercollection but (as far as I can tell from what I tried) it does NOT fire when the content of an expression is changed. But again the SchemaChanged event helped me out!

Thank you!

Mohanraj Gunasekaran [Syncfusion]
Replied On February 21, 2017 03:41 PM UTC

Hi Matthijs,  
 
Thanks for your update. 
 
We are glad to know that your reported problem has resolved. 
 
Please let us know, if you have any further assistance. 
 
Regards, 
Mohanraj G. 


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.

Warning Icon 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.Close Icon

;