Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1187
How to catch double click on daily view
posted

How can I get the time slot the user double clicked on from the ultradayview?  I have it bound to an ultracalendarinfo and the selected date ranges is always empty.

 

Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    void dayView_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        UltraDayView dayView = sender as UltraDayView;
        TimeSlot timeSlot = dayView.GetTimeSlotFromPoint( e.Location );
        VisibleDay visibleDay = dayView.GetVisibleDayFromPoint( e.Location );

        if ( visibleDay != null && timeSlot != null )
        {
            System.Globalization.DateTimeFormatInfo dateFormatInfo =
                System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat;

            string dateFormat = string.Format( "{0} {1}", dateFormatInfo.ShortDatePattern, dateFormatInfo.ShortTimePattern );
            DateTime date = visibleDay.Date.Add( timeSlot.StartTime.TimeOfDay );
            MessageBox.Show( date.ToString( dateFormat ) );
        }
    }

Children
No Data