Hit Test Functionality
The dbicDayView "Hit Test" functionality provides the developer with the ability to programmatically surface any of the objects (appointments, contacts, columns, locations, tasks, custom areas) at any given point in the control. Additionally, the DateTimeAt method is designed to report the current DateTime values at any point in the control. These methods are ideal for enhancing Drag Drop operations and for giving developers more flexibility for creating custom UI based on the cursor location such as the addtion of custom context menus that reflect functionality specific to the objects under the mouse.
There are twelve hit test methods included in the dbicDayView control. Each of the methods is overloaded to accept a location defined as System.Drawing.Point, or as an X and Y coordinate.
DateTimeAt - Converts a location into a date time value representing the Date and Time in the control at the specified location .
DayViewItemAt - Returns an enum value describing the area of the dbicDayView control at the specified location . Areas of the control reported are AllDay, Header, None, Schedule, Time, Title, Title2.
CustomAreasAt - Returns a collection of CustomArea objects at the specified location .
AppointmentObjectAt - Returns the appointment object at the specified location in the dbicDayView control.
ContactObjectAt - Returns the contact object assigned to the column at the specified location in the dbicDayView control.
LocationObjectAt - Returns the location object assigned to the column at the specified location in the control.
TaskObjectAt - Returns the task object assigned to the column at the specified location in the control.
ColumnAt - Converts a location into the index value of the column (in the dbicDayView collection of Columns) at the specified location .
AppointmentAt - Converts a location into the index value of the appointment (in the dbicDayView collection of Appointments) at the specified location .
ContactAt - Converts a location into the index value of the contact (in the dbicDayView collection of Contacts) assigned to the column at the specified location .
LocationAt - Converts a location into the index value of the location (in the dbicDayView collection of Locations) assigned to the column at the specified location .
TaskAt - Converts a location into the index value of the task (in the dbicDayView collection of Tasks) assigned to the column at the specified location .
For an example of the implementation of Hit Test Functionality please review the dbicDayViewHitTest sample application that accompanies the product.