void GetSortingProperties() { SortInfoCollectionMsx sic = SortingPropertiesPanel.GetValues(); V.SortingByColumn = V.ThenBy1Column = V.ThenBy2Column = ""; for (int i1 = 0; i1 < sic.SortList.Count; i1++) { SortInfoMsx si = sic.SortList[i1]; string col = si.DataColumnReference.Name; SortOrderMsx so = si.SortOrder; if (i1 == 0) { V.SortingByColumn = col; V.SortingByType = so; } else if (i1 == 1) { V.ThenBy1Column = col; V.ThenBy1Type = so; } else if (i1 == 2) { V.ThenBy2Column = col; V.ThenBy2Type = so; } } return; }
void AddSortInfo( SortInfoCollectionMsx sic, string col, SortOrderMsx sortType) { if (!Lex.IsDefined(col)) { return; } SortInfoMsx si = new SortInfoMsx(); si.DataColumnReferenceSerializedId = col; DataTableMsx dt = V.DataTable; if (dt == null) { dt = Api?.Document?.ActiveDataTableReference; } if (dt != null) { si.DataColumnReference = dt.GetColumnByName(col); } si.SortOrder = sortType; sic.SortList.Add(si); return; }