This is a migrated thread and some comments may be shown as answers.

How to trigger schedule cellformating event in other event ?

3 Answers 174 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Cooper
Top achievements
Rank 1
Cooper asked on 17 Mar 2014, 10:58 AM
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);
        }

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Mar 2014, 10:49 AM
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.

 
0
Scott
Top achievements
Rank 1
answered on 06 Dec 2014, 05:03 AM
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
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Dec 2014, 06:47 PM
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.

 
Tags
Scheduler and Reminder
Asked by
Cooper
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Scott
Top achievements
Rank 1
Share this question
or