Esempio n. 1
0
        ///<summary>
        /// GridColumn
        ///</summary>
        public GridColumn()
        {
            SetState(Cs.AllowEdit, true);
            SetState(Cs.MarkRowDirtyOnCellValueChange, true);

            _SelectedCells = new SelectedElements();
        }
Esempio n. 2
0
        /// <summary>
        /// Handles invocation of RowRestored events
        /// </summary>
        internal void DoRowRestoredEvent(GridPanel panel, SelectedElements selRows)
        {
            if (RowRestored != null)
            {
                GridRowRestoredEventArgs ev = new
                    GridRowRestoredEventArgs(panel, selRows);

                RowRestored(this, ev);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Handles invocation of RowRestoring events
        /// </summary>
        internal bool DoRowRestoringEvent(GridPanel panel, SelectedElements selRows)
        {
            if (RowRestoring != null)
            {
                GridRowRestoringEventArgs ev = new
                    GridRowRestoringEventArgs(panel, selRows);

                RowRestoring(this, ev);

                return (ev.Cancel);
            }

            return (false);
        }
Esempio n. 4
0
        private void RestoreRows(GridPanel panel, SelectedElements selRows)
        {
            for (int i = selRows.Ranges.Count - 1; i >= 0; --i)
            {
                SelectedRange range = selRows.Ranges[i];

                if (panel.VirtualMode == true)
                {
                    panel.SetDeletedRows(range.StartIndex, range.Count, false);
                }
                else
                {
                    for (int j = range.EndIndex; j >= range.StartIndex; --j)
                    {
                        GridContainer row = panel.GetRowFromIndex(j);

                        if (row != null)
                            row.IsDeleted = false;
                    }
                }
            }

            DoRowRestoredEvent(panel, selRows);
        }
Esempio n. 5
0
        private void DeleteRows(GridPanel panel, SelectedElements selRows)
        {
            BeginUpdate();

            for (int i = selRows.Ranges.Count - 1; i >= 0; --i)
            {
                SelectedRange range = selRows.Ranges[i];

                if (panel.VirtualMode == true)
                {
                    panel.SetDeletedRows(range.StartIndex, range.Count, true);
                }
                else
                {
                    for (int j = range.EndIndex; j >= range.StartIndex; --j)
                    {
                        GridContainer row = panel.GetRowFromIndex(j);

                        if (row != null)
                            row.IsDeleted = true;
                    }
                }
            }

            if (_ActiveRow != null && _ActiveRow.IsDeleted == true)
            {
                if (_ActiveRow.Parent != null)
                    ActiveRow = ((GridContainer)_ActiveRow.Parent).GetNextLocalItem(_ActiveRow.RowIndex);
            }

            //panel.UpdateRowCountEx();

            EndUpdate();

            DoRowDeletedEvent(panel, selRows);
        }
Esempio n. 6
0
 ///<summary>
 /// GridRowRestoringEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="selRows"></param>
 public GridRowRestoringEventArgs(GridPanel gridPanel, SelectedElements selRows)
     : base(gridPanel, selRows)
 {
 }
Esempio n. 7
0
 ///<summary>
 /// GridRowDeletedEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 ///<param name="selRows"></param>
 public GridRowDeletedEventArgs(GridPanel gridPanel, SelectedElements selRows)
     : base(gridPanel)
 {
     _SelectedRows = selRows;
 }
Esempio n. 8
0
        internal SelectedElements Copy()
        {
            SelectedElements copy = new SelectedElements();

            foreach (SelectedRange range in _Ranges)
                copy.AddRange(range.StartIndex, range.EndIndex);

            return (copy);
        }