/// <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); }
private void ShowColumnSelectorMenu() { throw new NotImplementedException(); // todo... #if false QueryColumn qc; DataRow dr; ColumnMapMsx colMap; int ri, ci; MouseEventArgs e = LastMouseDownEventArgs; Point p = new Point(e.X, e.Y); BandedGridHitInfo ghi = V.CalcHitInfo(p); ri = ghi.RowHandle; //if (ri < 0) return; BandedGridColumn col = ghi.Column; if (col == null) { return; } ci = col.AbsoluteIndex; if (ci != LabelCol) { return; } qc = null; // existing assignment if (ri != GridControl.NewItemRowHandle) { dr = DataTable.Rows[ri]; string spotfireName = dr[LabelCol] as string; qc = CurrentMap.ColumnMapCollection.GetQueryColumnForSpotfireColumnName(spotfireName); } ColumnSelectorFromQueryMsx csc = new ColumnSelectorFromQueryMsx(); csc.Setup(SVP, qc); csc.Flags.ExcludeNonNumericTypes = true; Point screenLoc = this.PointToScreen(p); QueryColumn qc2 = csc.ShowMenu(screenLoc); if (qc2 == null) { return; } if (ri == GridControl.NewItemRowHandle) // adding row { dr = DataTable.NewRow(); DataTable.Rows.Add(dr); if (IconImage.Visible) { dr[ValCol] = "(Min)"; dr[ValCol2] = "(Max)"; dr[IconImageCol] = Bitmaps.GetImageIndexFromName(ColumnImageCollection, CondFormat.DefaultColorScale); } else { Color[] ca = Bitmaps.GetColorSetByName(Bitmaps.ColorSetImageColors, CondFormat.DefaultColorSet); if (ca != null && ca.Length > 0) { dr[BackColorCol1] = ca[DataTable.Rows.Count % ca.Length]; } } } else { dr = DataTable.Rows[ri]; } colMap = CurrentMap.UpdateColumnMapList(qc2); dr[LabelCol] = colMap.SpotfireColumnName; return; #endif }