Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1085
Filter Selections get lost after Loading View
posted

Hi! 

I have some troubles with the Filter Selections in xamPivotGrid.

 

I use the methods provided in your samples to save/load views and it works very well, except one bug with the filters. Way to reproduce:

 

- Open any view, select some Filter Values:

 

- Save the view

- reopen (load) the view.

- Click on the Filter's handle to open the Filter list -> The saved selections have been restored and all values are right-> everything seems to be fine:

 

- Click on Cancel (or on the Filter's handle again)  to close the Filter list.

- Click on the Filter's handle again to open the Filter list -> Suddenly ALL items are selected:

 

Code used to select filters on load (taken from your example on how to load/save views):

 

                    foreach (IFilterViewModel filterViewModel in dataSource.Filters)

                    {

                        while (filterViewModel.FilterMembers == null)

                        {

                            System.Threading.Thread.Sleep(100);

                        }

 

                        if (filterViewModel.FilterMembers != null)

                            foreach (IFilterMember filterMember in filterViewModel.FilterMembers)

                                SelectMembers(filterMember);

                    }

 

where selectmembers looks like:

 

      private void SelectMembers(IFilterMember filterMember)

        {

            if (filterMember.FilterMembers != null)

            {

                foreach (IFilterMember subFilterMember in filterMember.FilterMembers)

                {

                    SelectMembers(subFilterMember);

                }

            }

 

            XamPivotGridData.CustomDictItem tmpItem = GetCustomDictItem(CurrentPivotGridData.FilterMembersToLoad, filterMember.Member.UniqueName);

 

            if (tmpItem != null) { filterMember.IsSelected = tmpItem.Value; }        

        }

 

Thanks in advance,

 

Daniel