A newer version of this page is available. Switch to the current version.

SchedulerControl.CalcHitInfo(Point) Method

Returns information on the scheduler element located at the specified point.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v18.2.dll


public ISchedulerHitInfo CalcHitInfo(
    Point hitPoint


Name Type Description
hitPoint Point

A ISchedulerHitInfo object contains information about a Scheduler element located at the test point.


Type Description

A Point structure which specifies the test point coordinates relative to the top left corner.


The following code snippet shows how to use the SchedulerControl.CalcHitInfo method in the Scheduler.MouseMove event handler to obtain the hit information for the scheduler element over which the mouse pointer is hovering. The information on the element located under the mouse pointer is shown in the top panel.


private void SchedulerControl_MouseMove(object sender, MouseEventArgs e)
    // Obtain hit information under the test point.
    Point position = e.GetPosition(schedulerControl1);
    ISchedulerHitInfo hitInfo = schedulerControl1.CalcHitInfo(position);
    if (hitInfo != null) {
        this.hitResultsHeader.Text = "Hit Test Results";
        StringBuilder builder = new StringBuilder();
        builder.AppendLine(Enum.GetName(typeof(SchedulerHitTestType), hitInfo.HitTestType));
        switch (hitInfo.HitTestType) {
            case SchedulerHitTestType.Appointment:
                AppointmentViewModel appViewModel = hitInfo.ViewModel as AppointmentViewModel;
                if (appViewModel != null) {
                    builder.AppendLine("Subject: " + appViewModel.Appointment.Subject);
                    builder.AppendLine("Start: " + appViewModel.Appointment.Start.ToString());
                    builder.AppendLine("End: " + appViewModel.Appointment.End.ToString());
            case SchedulerHitTestType.Cell:
                builder.AppendLine("Interval: " + hitInfo.ViewModel.Interval.ToString());
                builder.AppendLine("Selected: " + hitInfo.ViewModel.IsSelected.ToString());
            case SchedulerHitTestType.Ruler:
               TimeRulerCellViewModel rulerViewModel = hitInfo.ViewModel as TimeRulerCellViewModel;
                if (rulerViewModel != null) {
                    builder.AppendLine("Time: " + rulerViewModel.Time.ToString());
                    builder.AppendLine("Time Scale: " + rulerViewModel.TimeScale.ToString());
        this.hitResultsText.Text = builder.ToString();
    else {
See Also