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); }
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); }