简体   繁体   中英

I want to override on AllowCreate, How to override this method in TelerikSchedule with Blazor?

When AllowCreate="true", its automatically opened own appointment addDialog?. I want Stop that and want move custom page(My own page).

I added screenshot about razor enter image description here file. Please see that and help me. Thank You!.

I found a solution like below for my question.

Razor file code:

<TelerikScheduler
           Data="@Appointments"
           Date="@StartDate"
           OnItemClick="@OnItemClick"
           @bind-View="@CurrView"
           DateChanged="@DateChangedHandler"
           Height="480px">

               <SchedulerResources>
                   <SchedulerResource Field="ManagerName" Data="@Managers" />
               </SchedulerResources>

               <SchedulerViews> 

               <SchedulerWeekView
                   StartTime="@DayStart"
                   EndTime="@DayEnd"                  
                   SlotDuration="30"
                   SlotDivisions="5"/>

               </SchedulerViews>

           </TelerikScheduler>

And also, I created method for automatically generate slot in cs file

private void SlotGenerated() 
    {        
        DateTime st = new DateTime(2022, 6, 1, 8, 0, 0);
        DateTime ed = DateTime.Today.AddMonths(2);
        int i = 1;
        while (st <= ed)
        {
            if (i == 6) { i = 1;  }

            AppointmentDto appointment = new AppointmentDto();

            appointment.Id = 0;
            appointment.Start = st;
            appointment.End = st.AddMinutes(6);
            appointment.Name = "SLOT " + i;
            appointment.IsAllDay = false;
            appointment.ManagerName = "1";


            Appointments.Add(appointment);

            st = st.AddMinutes(6);
            ++i;`enter code here`
        }
        UIStateChanged();
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM