public bool SetDefaultSortFilter(int colIndex, SortOrder ss, bool update = true) { m_AllLevelSortFilter.SortLevel.Clear(); if (ss != SortOrder.None) { Filter.Sort.Level sl = new Filter.Sort.LevelByIndex(colIndex, ss); m_AllLevelSortFilter.SortLevel.Add(sl); } if (update) { UpdateDisplayTable(); } ReportFilterChanges(); return(true); }
// return if something change public bool AddSubSortFilter(int colIndex, SortOrder ss, bool update = true) { Filter.Sort.Level sl = new Filter.Sort.LevelByIndex(colIndex, ss); int index = m_AllLevelSortFilter.SortLevel.FindIndex(x => x.GetColumnIndex(m_TableSource) == colIndex); if (index >= 0) { if (m_AllLevelSortFilter.SortLevel[index].Equals(sl)) { return(false); } m_AllLevelSortFilter.SortLevel[index] = sl; } else { m_AllLevelSortFilter.SortLevel.Add(sl); } if (update) { UpdateDisplayTable(); } ReportFilterChanges(); return(true); }