/// <summary> /// Handles the mouse down event of the columns grid /// </summary> /// <param name="sender">Object that fired the event</param> /// <param name="e">.NET supplied event args</param> private void dgColumns_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { DataGrid gvCols = (DataGrid)sender; hti = gvCols.HitTest(e.X, e.Y); switch (hti.Type) { case DataGrid.HitTestType.ColumnHeader: if (e.Button.Equals(MouseButtons.Right)) { ContextMenu dgMenu = new ContextMenu(); MenuItem delete = new MenuItem(SharedStrings.DELETE); delete.Click += new EventHandler(delete_Click); dgMenu.MenuItems.Add(delete); dgMenu.Show((Control)sender, e.Location); } break; case DataGrid.HitTestType.ColumnResize: break; default: break; } }