System.Windows.Forms.DataGridViewRowCollection.RemoveAt(int)

Here are the examples of the csharp api class System.Windows.Forms.DataGridViewRowCollection.RemoveAt(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

9 Examples 7

1. Example

Project: My-FyiReporting
Source File: FiltersCtl.cs
View license
private void bDelete_Click(object sender, System.EventArgs e)
		{
            if (dgFilters.CurrentRow == null)
                return;

            if (!dgFilters.Rows[dgFilters.CurrentRow.Index].IsNewRow)   // can't delete the new row
                dgFilters.Rows.RemoveAt(this.dgFilters.CurrentRow.Index);
            else
            {   // just empty out the values
                DataGridViewRow dgrv = dgFilters.Rows[this.dgFilters.CurrentRow.Index];
                dgrv.Cells[0].Value = null;
                dgrv.Cells[1].Value = "Equal";
                dgrv.Cells[2].Value = null;
            }
		}

2. Example

Project: My-FyiReporting
Source File: SortingCtl.cs
View license
private void bDelete_Click(object sender, System.EventArgs e)
		{
            if (dgSorting.CurrentRow == null)
                return;

            if (!dgSorting.Rows[dgSorting.CurrentRow.Index].IsNewRow)   // can't delete the new row
                dgSorting.Rows.RemoveAt(this.dgSorting.CurrentRow.Index);
            else
            {   // just empty out the values
                DataGridViewRow dgrv = dgSorting.Rows[this.dgSorting.CurrentRow.Index];
                dgrv.Cells[0].Value = null;
                dgrv.Cells[1].Value = null;
            }
        }

3. Example

Project: pgina
Source File: ConfigurationUI.cs
View license
private void MoveUp(DataGridView dgv, int index)
        {
            if (index > 0)
            {
                DataGridViewRow row = dgv.Rows[index];
                dgv.Rows.RemoveAt(index);
                dgv.Rows.Insert(index - 1, row);
                dgv.Rows[index - 1].Selected = true;
            }
        }

4. Example

Project: pgina
Source File: ConfigurationUI.cs
View license
private void MoveDown(DataGridView dgv, int index)
        {
            int rows = dgv.Rows.Count;
            if (index < rows - 1)
            {
                DataGridViewRow row = dgv.Rows[index];
                dgv.Rows.RemoveAt(index);
                dgv.Rows.Insert(index + 1, row);
                dgv.Rows[index + 1].Selected = true;
            }
        }

5. Example

Project: tcp-gecko-dotnet
Source File: watchlist.cs
View license
public void DeleteSelected()
        {
            for (int i = watchOut.SelectedRows.Count - 1; i >= 0; i--)
            {
                int index = watchOut.SelectedRows[i].Index;
                addressWatchList.RemoveAt(index);
                watchOut.Rows.RemoveAt(index);
            }
        }

6. Example

Project: CodeContracts
Source File: MainForm.cs
View license
static private void InsertOrUpdate(DataGridView grid, int Id, string[] row)
    {
      Contract.Requires(grid != null);

      int index = 0;
      if (TryFindProcInRows(grid, Id.ToString(), out index))
      {
        var rowIsSelected = grid.CurrentRow.Index == index;
        grid.Rows.RemoveAt(index);
        grid.Rows.Insert(index, row);

        if (rowIsSelected)
        {
          // TODO: how do we set a row?
        }
      }
      else
      {
        grid.Rows.Insert(0, row);
      }
    }

7. Example

View license
protected void onSortableDragDrop(object sender, DragEventArgs e)
        {
            Point point = this.PointToClient(new Point(e.X, e.Y));
            ddSort.to = this.HitTest(point.X, point.Y).RowIndex;

            if(e.Effect != DragDropEffects.Move || ddSort.to == -1 || Rows.Count < 1 || Rows[ddSort.to].IsNewRow) {
                return;
            }
            e.Effect = DragDropEffects.None;

            this.Rows.RemoveAt(ddSort.from);
            this.Rows.Insert(ddSort.to, (DataGridViewRow)e.Data.GetData(typeof(DataGridViewRow)));
            this.ClearSelection();
            this.Rows[ddSort.to].Selected = true;

            DragDropSortedRow(this, new MovingRowArgs() { Data = ddSort });
        }

8. Example

Project: bitdiffer
Source File: FileSystemDataGridView.cs
View license
protected override void OnCellContentClick(DataGridViewCellEventArgs e)
        {
            base.O/n ..... /n //View Source file for more details /n }

9. Example

Project: InnovatorAdmin
Source File: DataGrid.cs
View license
public void Paste()
    {
      if (this.IsCurrentCellInEditMode)
      {
        // do nothing
    /n ..... /n //View Source file for more details /n }