Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
        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);
        }