This is a migrated thread and some comments may be shown as answers.

getting Filter programmatically server side

1 Answer 57 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Jérome
Top achievements
Rank 1
Jérome asked on 19 Feb 2015, 02:04 PM
Hello,

I have implemented a page loading a pivotgrid from an xml file using Persistence Framework and it works fine.
my pivotgrid use OLAP datasource.

I would like to get the filter set for a specific dimension in the pivotgrid and display in a textbox the selected value for the filter, programmatically server side.

I looked for documentation in the online documentation and in threads in this forum but didn't found anything about how to do this.

is it possible to do this and how can I implement a solution?

thanks in advance.

regards

1 Answer, 1 is accepted

Sort by
0
Jérome
Top achievements
Rank 1
answered on 24 Feb 2015, 08:47 AM
Hello,

I have a solution. dirty but it works

my example gets the selected year for the filter of my dimension "Year"

string year = string.Empty;
            if (this.PivotGrid.Filters.Count > 0)
            {
                var conditions = ((Telerik.Web.UI.PivotGrid.Core.Olap.OlapSetCondition)(((Telerik.Web.UI.PivotGrid.Core.Filtering.OlapLabelGroupFilter)(this.PivotGrid.Filters[0].GetDataEngineFilter())).Condition));
                foreach (var item in conditions.Items.AsEnumerable())
                {
                    year = item.ToString();
                    break;
                }
            }
Tags
PivotGrid
Asked by
Jérome
Top achievements
Rank 1
Answers by
Jérome
Top achievements
Rank 1
Share this question
or