/// <summary> /// Fired when the number of columns change /// </summary> /// <param name="e"></param> protected virtual void OnRowsRemoved(IndexRangeEventArgs e) { if (RowsRemoved != null) { RowsRemoved(this, e); } }
/// <summary> /// Fired when the number of columns change /// </summary> /// <param name="e"></param> protected virtual void OnColumnsRemoved(IndexRangeEventArgs e) { if (ColumnsRemoved != null) { ColumnsRemoved(this, e); } }
private void m_Columns_ColumnsRemoved(object sender, IndexRangeEventArgs e) { //N.B. Uso m_Cells.GetLength(0) anziche' RowsCount e // m_Cells.GetLength(1) anziche' ColumnsCount per essere sicuro di lavorare sulle righe effetivamente allocate for (int c = (e.StartIndex + e.Count); c < CellsCols; c++) { for (int r = 0; r < CellsRows; r++) { ICell tmp = m_Cells[r, c]; RemoveCell(r, c); InsertCell(r, c - e.Count, tmp); } } RedimCellsMatrix(CellsRows, CellsCols - e.Count); if (Redraw) { RefreshGridLayout(); } }
private void m_Columns_ColumnsAdded(object sender, IndexRangeEventArgs e) { //N.B. Uso m_Cells.GetLength(0) anziche' RowsCount e // m_Cells.GetLength(1) anziche' ColumnsCount per essere sicuro di lavorare sulle righe effetivamente allocate RedimCellsMatrix(CellsRows, CellsCols + e.Count); //dopo aver ridimensionato la matrice sposto le celle in modo da fare spazio alla nuove righe for (int c = CellsCols - 1; c > (e.StartIndex + e.Count - 1); c--) { for (int r = 0; r < CellsRows; r++) { ICell tmp = m_Cells[r, c - e.Count]; RemoveCell(r, c - e.Count); InsertCell(r, c, tmp); } } if (Redraw) { RefreshGridLayout(); } }