Ejemplo n.º 1
0
        /// <summary>
        /// Autosizes all cols of a given <c><see cref="YataGrid"/></c>.
        /// </summary>
        /// <param name="table"></param>
        /// <remarks>Helper for
        /// <c><see cref="opsclick_AutosizeCols()">opsclick_AutosizeCols()</see></c>
        /// and <c><see cref="DiffReset()">DiffReset()</see></c>.</remarks>
        static void AutosizeCols(YataGrid table)
        {
            foreach (var col in table.Cols)
            {
                col.UserSized = false;
            }

            table.Calibrate(0, table.RowCount - 1);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Overwrites a row in accord with
        /// <c><see cref="Undo()">Undo()</see></c> or
        /// <c><see cref="Redo()">Redo()</see></c>.
        /// </summary>
        void Overwrite()
        {
            //logfile.Log("UndoRedo.Overwrite()");

            Row row = _it.r;
            int r   = row._id;

            _grid.Rows[r] = row.Clone() as Row;
            _grid.Calibrate(r);

            _grid.ClearSelects(false, true);
            _grid.Rows[r].selected = true;
            _grid.EnsureDisplayedRow(r);


            _grid.Invalidator(YataGrid.INVALID_GRID
                              | YataGrid.INVALID_ROWS);

            if (Settings._autorder && Yata.order() != 0)
            {
                _grid._f.layout();
            }
        }