Example #1
0
 private void DataGrid_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         gridMenu.Show(ProxyDataGrid, ProxyDataGrid.PointToClient(Cursor.Position));
     }
 }
Example #2
0
 private void DataGrid_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         if (!(ProxyDataGrid.SelectedRows.Count > 1))
         {
             ProxyDataGrid.ClearSelection();
         }
         try
         {
             ProxyDataGrid.Rows[e.RowIndex].Selected = true;
             cellMenu.Show(ProxyDataGrid, ProxyDataGrid.PointToClient(Cursor.Position));
         }
         catch { }
     }
 }