SchedulerViewBase.ViewInfo Property

Gets the current object’s view information.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v21.1.dll


public SchedulerViewInfoBase ViewInfo { get; }

Property Value

Type Description

A SchedulerViewInfoBase object providing view information on all the SchedulerViewBase‘s elements.


The ViewInfo property provides access to an object that introduces properties and methods which give you the ability to obtain all the view information about the current SchedulerViewBase object’s elements. This property is overridden by the SchedulerViewBase descendants to provide the view information specific to each type of View.


The following examples demonstrate how to handle the SchedulerControl.MouseMove event and calculate the hit information for the point which the mouse pointer is currently hovering over. The information on the element located under the mouse pointer is shown within the form caption.

The second parameter of the SchedulerViewInfoBase.CalcHitInfo method enables you to specify whether you need information on an appointment being clicked, or on a scheduler element located underneath.

When you drag an appointment over the scheduler, you can use the SchedulerViewInfoBase.CalcHitInfo method to determine the scheduler area below. If you drag appointment to the All-Day Area, you can cancel the action.


View Example

using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Drawing;
using System;
using System.Drawing;
using System.Windows.Forms;
        private void schedulerControl1_MouseMove(object sender, MouseEventArgs e)
            SchedulerControl scheduler = sender as SchedulerControl;
            if (scheduler == null) return;

            Point pos = new Point(e.X, e.Y);
            SchedulerViewInfoBase viewInfo = schedulerControl1.ActiveView.ViewInfo;
            SchedulerHitInfo hitInfo = viewInfo.CalcHitInfo(pos, false);

            if (hitInfo.HitTest == SchedulerHitTest.AppointmentContent)
                Appointment apt = ((AppointmentViewInfo)hitInfo.ViewInfo).Appointment;
                Text = apt.Subject;
            else if (scheduler.ActiveView.Type == SchedulerViewType.Day && hitInfo.HitTest == SchedulerHitTest.Cell)
                int diff = pos.Y - hitInfo.ViewInfo.Bounds.Y;
                long ticksPerPixel = hitInfo.ViewInfo.Interval.Duration.Ticks /
                long ticksCount = ticksPerPixel * diff;
                DateTime actualTime = hitInfo.ViewInfo.Interval.Start.AddTicks(ticksCount);
                Text = actualTime.ToString();
            else if (hitInfo.HitTest == SchedulerHitTest.None)
                Text = Application.ProductName;
            else Text = string.Empty;

        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;
See Also