Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DGV_Systems_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         try
         {
             DataGridView.HitTestInfo hti = DGV_Systems.HitTest(e.X, e.Y);
             if (hti.RowIndex >= 0)
             {
                 DGV_Systems.ClearSelection();
                 DGV_Systems.Rows[hti.RowIndex].Selected = true;
                 CMS_ManageSystems.Show(DGV_Systems, e.Location);
             }
         }
         catch (Exception) { }
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DGV_Systems_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                DataGridView.HitTestInfo hti = DGV_Systems.HitTest(e.X, e.Y);

                if (hti.RowIndex >= 0)
                {
                    DGV_Systems.ClearSelection();
                    DGV_Systems.Rows[hti.RowIndex].Selected = true;
                    DGV_Systems.CurrentCell = DGV_Systems.Rows[hti.RowIndex].Cells[0];
                }
            }
            catch (Exception)
            {
                DGV_Systems.ClearSelection();
            }
        }