/// <summary> /// Fired when the number of columns change /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.IndexRangeEventArgs"/> instance containing the event data.</param> protected virtual void OnColumnsRemoved(IndexRangeEventArgs e) { if (ColumnsRemoved != null) { ColumnsRemoved(this, e); } }
/// <summary> /// Fired when the number of columns change /// </summary> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.IndexRangeEventArgs"/> instance containing the event data.</param> protected virtual void OnRowsRemoved(IndexRangeEventArgs e) { if (RowsRemoved != null) { RowsRemoved(this, e); } }
private void 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 = cells[r, c]; RemoveCell(r, c); InsertCell(r, c - e.Count, tmp); } } RedimCellsMatrix(CellsRows, CellsCols - e.Count); if (Redraw) { RefreshGridLayout(); } }
/// <summary> /// Handles the ColumnsAdded event of the columns control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.IndexRangeEventArgs"/> instance containing the event data.</param> private void 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 = cells[r, c - e.Count]; RemoveCell(r, c - e.Count); InsertCell(r, c, tmp); } } if (Redraw) { RefreshGridLayout(); } }
private void rows_RowsRemoved(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 r = e.StartIndex + e.Count; r < CellsRows; r++) { for (int c = 0; c < CellsCols; c++) { ICell tmp = cells[r, c]; RemoveCell(r, c); InsertCell(r - e.Count, c, tmp); } } RedimCellsMatrix(CellsRows - e.Count, CellsCols); if (Redraw) { RefreshGridLayout(); } }
private void rows_RowsRemoved(object sender, IndexRangeEventArgs e) { Range l_RemovedRange = new Range(e.StartIndex, 0, e.StartIndex + e.Count - 1, ColumnsCount - 1); if (l_RemovedRange.Contains(FocusCellPosition)) { SetFocusCell(Position.Empty); } if (l_RemovedRange.Contains(mouseCellPosition)) { mouseCellPosition = Position.Empty; } if (l_RemovedRange.Contains(mouseDownPosition)) { mouseDownPosition = Position.Empty; } }
/// <summary> /// Handles the RowsAdded event of the rows control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.IndexRangeEventArgs"/> instance containing the event data.</param> private void rows_RowsAdded(object sender, IndexRangeEventArgs e) { if (Redraw && !this.DrawColLine) { RefreshGridLayout(); } }