// return if something change
        public bool AddSubGroupFilter(int colIndex, bool update = true)
        {
            var newFilter = new Filter.GroupByColumnIndex(colIndex, SortOrder.Ascending);


            var ds = new Database.Operation.Filter.DefaultSort(m_AllLevelSortFilter, null);

            var gfp = GetDeepestGroupFilter(m_Filters);

            if (gfp.child != null)
            {
                //add the new group with the default sort filter
                var newMulti = new Filter.Multi();
                newMulti.filters.Add(newFilter);
                newMulti.filters.Add(ds);
                var subf = gfp.child.SubGroupFilter;
                gfp.child.SubGroupFilter = newMulti;
                newFilter.SubGroupFilter = subf;
            }
            else
            {
                //add it to top, already has te default sort filter there
                newFilter.SubGroupFilter = ds;
                m_Filters.filters.Insert(0, newFilter);
            }

            if (update)
            {
                UpdateDisplayTable();
            }
            ReportFilterChanges();
            return(true);
        }
示例#2
0
        public override Filter Clone(FilterCloning fc)
        {
            GroupByColumnIndex o = new GroupByColumnIndex(m_ColumnIndex, m_Order);

            if (SubGroupFilter != null)
            {
                o.SubGroupFilter = SubGroupFilter.Clone(fc);
            }
            return(o);
        }