/// <summary> /// SetupSortColumn /// </summary> /// <param name="sortInfo"></param> /// <param name="selectorCtl"></param> /// <param name="ascendingCtl"></param> /// <param name="descendingCtl"></param> void SetupSortColumn( SortInfoMsx sortInfo, ColumnSelectorControl selectorCtl, CheckEdit ascendingCtl, CheckEdit descendingCtl, EventHandler editValueChangedEventHandler = null) { if (sortInfo == null) { sortInfo = new SortInfoMsx(); } selectorCtl.OptionIncludeNoneItem = true; AxisMsx axis = new AxisMsx(); DataColumnMsx dc = sortInfo.DataColumnReference; if (dc != null) { axis.Expression = ExpressionUtilities.EscapeIdentifier(dc.DataTable?.Name) + "." + (dc.Name); } selectorCtl.Setup(axis, V, SVP, editValueChangedEventHandler); if (sortInfo.SortOrder == SortOrderMsx.Ascending) { ascendingCtl.Checked = true; } else { descendingCtl.Checked = true; } return; }
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; }
/// <summary> /// SetupSortColumn /// </summary> /// <param name="sortInfo"></param> /// <param name="selectorCtl"></param> /// <param name="ascendingCtl"></param> /// <param name="descendingCtl"></param> void SetupSortColumn( SortInfoMsx sortInfo, ColumnSelectorFromQueryMsx selectorCtl, CheckEdit ascendingCtl, CheckEdit descendingCtl, EventHandler editValueChangedEventHandler = null) { QueryColumn qc = null; if (sortInfo == null) { sortInfo = new SortInfoMsx(); } if (sortInfo.DataColumnReference != null) { qc = SVP.DataTableMaps.CurrentMap.ColumnMapCollection.GetQueryColumnForSpotfireColumn(sortInfo.DataColumnReference); } selectorCtl.OptionIncludeNoneItem = true; selectorCtl.Setup(SVP, qc, editValueChangedEventHandler); if (sortInfo.SortOrder == SortOrderMsx.Ascending) { ascendingCtl.Checked = true; } else { descendingCtl.Checked = true; } return; }
SortInfoMsx GetSortColumn( ColumnSelectorFromQueryMsx selectorCtl, CheckEdit ascendingCtl) { ColumnMapMsx cm = selectorCtl.SelectedColumn; if (cm == null) { return(null); } SortInfoMsx si = new SortInfoMsx(); si.DataColumnReference = cm.SpotfireColumn; si.DataColumnReferenceId = cm.SpotfireColumnName; si.SortOrder = ascendingCtl.Checked ? SortOrderMsx.Ascending : SortOrderMsx.Descending; return(si); }
SortInfoMsx GetSortColumn( ColumnSelectorControl selectorCtl, CheckEdit ascendingCtl) { //ColumnMapMsx cm = selectorCtl.SelectedColumn; //if (cm == null) return null; SortInfoMsx si = new SortInfoMsx(); DataColumnMsx dc = selectorCtl.GetFirstSelectedDataColumn(); if (dc != null) { si.DataColumnReference = dc; si.DataColumnReferenceSerializedId = dc.ReferenceId; } si.SortOrder = ascendingCtl.Checked ? SortOrderMsx.Ascending : SortOrderMsx.Descending; return(si); }