I have a datatable with some data. It's attached to XtraPivotGrid as datasource. One of several columns - a date. I want to get changes, made by user in filter to use later them. Problem in that, what I can not correct to use values of the filter from programme code. As soon as I try to use the filter - in filter does appear nothing checked!
code (as example in manual):
' in the column "Date_Of_Document" of datatable there is following data: 2006, 2007 and 2008 yy.
' I do not want to see nothing, connected with 2006 - I exclude it from filter (I'm trying exclude...)
Dim dateField As PivotGridField = DE_PivotGrid.Fields("Date_Of_Document")
' PivotGridControl1.BeginUpdate() - not using now
Try
dateField.FilterValues.Clear()
dateField.FilterValues.Add("2008")
dateField.FilterValues.Add("2007")
dateField.FilterValues.FilterType = DevExpress.Data.PivotGrid.PivotFilterType.Included
Finally
' Unlock the control.
' PivotGridControl1.EndUpdate()
End Try
And here is that I get - ALL filter values was unchecked :(
We have 3 arrays: FilterValues.Values
FilterValues.ValuesIncluded
FilterValues.ValuesExcluded
debug print give me following:
Console.WriteLine(dateField.FilterValues.Values.Length.ToString) = 2
Console.WriteLine(dateField.FilterValues.ValuesIncluded.Length.ToString) = 2
Console.WriteLine(dateField.FilterValues.ValuesExcluded.Length.ToString) = 3 !!!!!!
But if user with mouse unchecked "year 2006", in the debug print we see:
Console.WriteLine(dateField.FilterValues.Values.Length.ToString) = 2
Console.WriteLine(dateField.FilterValues.ValuesIncluded.Length.ToString) = 2
Console.WriteLine(dateField.FilterValues.ValuesExcluded.Length.ToString) = 1 !!!!!!
Like end - adding of values to the filter in code does not take them out of excluded, or I mistaken?
______________________________________________________________________________
tThe problem was solved, see here:
http://www.devexpress.com/Support/Center/p/B131659.aspx