telerikblazorblazor-server-sidec#-6.0telerik-scheduler

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 herefile. Please see that and help me! Thank You!.


Solution

  • 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();
        }