Ejemplo n.º 1
0
        private void schedulerControl1_DragOver(object sender, DragEventArgs e)
        {
            SchedulerControl scheduler = sender as SchedulerControl;

            if (scheduler == null)
            {
                return;
            }

            Point            p    = scheduler.PointToClient(new Point(e.X, e.Y));
            SchedulerHitInfo info = scheduler.DayView.ViewInfo.CalcHitInfo(p, true);

            if (info.HitTest == SchedulerHitTest.AllDayArea)
            {
                e.Effect = DragDropEffects.None;
            }
        }
 void CurrentScheduler_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(DevExpress.XtraScheduler.Resource)))
     {
         SchedulerHitInfo dropHitInfo = CurrentScheduler.ActiveView.ViewInfo.CalcHitInfo(CurrentScheduler.PointToClient(new Point(e.X, e.Y)), false);
         if (dropHitInfo.HitTest == SchedulerHitTest.ResourceHeader)
         {
             Resource sourceResource = e.Data.GetData(typeof(DevExpress.XtraScheduler.Resource)) as DevExpress.XtraScheduler.Resource;
             Resource targetResource = dropHitInfo.ViewInfo.Resource;
             if (sourceResource != targetResource)
             {
                 object sourceResourceSortOrder = sourceResource.CustomFields[CustomFieldName];
                 sourceResource.CustomFields[CustomFieldName] = targetResource.CustomFields[CustomFieldName];
                 targetResource.CustomFields[CustomFieldName] = sourceResourceSortOrder;
                 ApplySorting();
             }
         }
     }
 }