System.Windows.Forms.DataGridView.OnCellMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs)

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

3 Examples 7

1. Example

Project: Krypton
Source File: KryptonDataGridView.cs
View license
protected override void OnCellMouseDown(DataGridViewCellMouseEventArgs e)
        {
            _cellDown = new Point(e.ColumnIndex, e.RowIndex);

            // If mouse down over the columns or row headers then turn off double buffering,
            // because if the user is using the mouse to resize a header item then it will use
            // an XOR painting technique to draw the resizing bar and double buffering causes
            // the painting to fail.
            if ((_cellDown.X == -1) || (_cellDown.Y == -1))
                DoubleBuffered = false;

            base.OnCellMouseDown(e);
        }

2. Example

Project: InnovatorAdmin
Source File: DataGrid.cs
View license
protected override void OnCellMouseDown(DataGridViewCellMouseEventArgs e)
    {
      selected = this.SelectedCells;

      base.OnCellMouseDown(e);
    }

3. Example

Project: SQLMonitor
Source File: OutlookGrid.cs
View license
protected override void OnCellMouseDown(DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                base.OnCellMouseDown(e);
                return;
            }
            var row = (OutlookGridRow)base.Rows[e.RowIndex];
            if (row.IsGroupRow && row.IsIconHit(e))
            {
                Debug.WriteLine("OnCellMouseDown " + DateTime.Now.Ticks.ToString());
                row.Group.Collapsed = !row.Group.Collapsed;

                //this is a workaround to make the grid re-calculate it's contents and backgroun bounds
                // so the background is updated correctly.
                // this will also invalidate the control, so it will redraw itself
                row.Visible = false;
                row.Visible = true;
            }
            else
                base.OnCellMouseDown(e);
        }