How to trigger schedule cellformating event in other event ?

4 posts, 0 answers
  1. Cooper
    Cooper avatar
    19 posts
    Member since:
    Mar 2014

    Posted 17 Mar 2014 Link to this post

    How do I pass RadScheduler_CellFormatting Telerik.WinControls.UI.SchedulerCellEventArgs in radSchedulerNavigator_NavigateForwardsClick?

      private void radSchedulerNavigator1_NavigateBackwardsClick(object sender, EventArgs e)
            {
               
                this.radCalendar1.FocusedDate = this.radScheduler1.ActiveView.StartDate;

                string  time_Nback1  = "";
                string time_Nback2 = "";

                if (radScheduler1.ActiveViewType == SchedulerViewType.Day)
                {
                    SchedulerDayView dayView_ck = this.radScheduler1.GetDayView();
                    time_Nback1 = dayView_ck.StartDate.ToString("yyyyMMdd");
                    time_Nback2 = dayView_ck.EndDate.ToString("yyyyMMdd");
                }
                else if (radScheduler1.ActiveViewType == SchedulerViewType.Week)
                {
                    SchedulerWeekView weekView_ck = this.radScheduler1.GetWeekView();
                    time_Nback1 = weekView_ck.StartDate.ToString("yyyyMMdd");
                    time_Nback2 = weekView_ck.EndDate.ToString("yyyyMMdd");
                }
                else if (radScheduler1.ActiveViewType == SchedulerViewType.Month)
                {
                    SchedulerMonthView monthView_ck = this.radScheduler1.GetMonthView();
                    time_Nback1 = monthView_ck.StartDate.ToString("yyyyMMdd");
                    time_Nback2 = monthView_ck.EndDate.ToString("yyyyMMdd");
                }

                boundradschedulerview("001", time_Nback1, time_Nback2);
                dtHoilday = boundAppointmentObj.listDoctorOffTime("001", time_Nback1, time_Nback2);
                radScheduler1_CellFormatting(sender, (Telerik.WinControls.UI.SchedulerCellEventArgs) e);
            }

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3378 posts

    Posted 20 Mar 2014 Link to this post

    Hello Cooper,

    Thank you for contacting Telerik Support.

    By default, when you navigate with the backward/forward buttons of the RadSchedulerNavigator, the CellFormatting event is fired. In addition, you can force the firing of the CellFormatting event via refreshing the SchedulerElement:
    this.radScheduler1.SchedulerElement.Refresh();

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. Scott
    Scott avatar
    4 posts
    Member since:
    Oct 2012

    Posted 05 Dec 2014 Link to this post

    I had the same question recently and learned that SchedulerElement.Refresh() has been deprecated. You should instead use

    this.radScheduler1.SchedulerElement.RefreshViewElement();

    intellisense should inform you of this automatically, just wanted to post here as well. Would be nice to see something mentioned here: http://www.telerik.com/help/winforms/scheduler-appearance-formatting-cells.html
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3378 posts

    Posted 10 Dec 2014 Link to this post

    Hello Scott,

    Thank you for writing.

    When you build your application, a warning message appears to notify the user that the SchedulerElement.Refresh method is obsolete and you should use the RefreshViewElement method instead. Please refer to the attached screenshot.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top