private void gcDefAppt_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { try { GridView view = ((GridControl)sender).MainView as GridView; if (e.Button == MouseButtons.Left && mouseDownHitInfo != null && !schedulerDataStorage.IsUpdateLocked) { RolesAndOrPermissions.ExecuteActionUIOnException(RequiredRoles, RequiredPermissions, () => { if (schedulerDataStorage.Resources.Items.Find(r => r.Visible == true) != null) { Size dragSize = SystemInformation.DragSize; Rectangle dragRect = new Rectangle(new Point(mouseDownHitInfo.HitPoint.X - dragSize.Width / 2, mouseDownHitInfo.HitPoint.Y - dragSize.Height / 2), dragSize); if (!dragRect.Contains(new Point(e.X, e.Y)) && view.FocusedRowHandle > -1) { view.GridControl.DoDragDrop(GetDragData(view), DragDropEffects.All); mouseDownHitInfo = null; } } else { MessageBox.Show("Please select a user from the group/user tree before trying to book a job", "No User Selected", MessageBoxButtons.OK, MessageBoxIcon.Information); } }); } } catch (Exception ex) { Logger.Error(ex.Message, ex); #if DEBUG throw ex; #endif } }