Radzen Scheduler Set Year Range

Hello!

Is it possible to set range of years in scheduler? Like i only need current year and previous on this select year button

Thank you soo much!

Hi @Joshua_Armando,

While this isn't supported out of the box you can probably inherit from RadzenYearView and override its Next and Prev methods.

Cool. Thank you so much sir!

Hi Sir Korchev. Do you have any Demos that tackles this Next and Prev Methods? I tried to search but cannot find one. Thank you so much.

We don't have such demos but this is simple inheritance:

  1. Inherit from RadzenYearView
    public class MyYearView : RadzenYearView
    {
    }
    
  2. Override those methods in your class
  3. Use your class in RadzenScheduler
<RadzenScheduler>
   <MyYearView />
</RadzenScheduler>

This is cool. Thank you so much sir Korchev!

Hi Sir Korchev!

Will there be a Demo for this custom Year View? Or can you give me example of methods that i can override.

Thank you so much sir!

No. I provided instructions what you need to do.

I already did. You need to override the Next and Prev methods to return the current year and previous year. Check the source code for the current implementation and use it to implement yours.

Hello!

Your solution worked for me. Thank you so much sir Korchev!

Hi Korchev!

While i was working on the solution you suggested.

This shows an error on SchedulerViewBase

I did inherit the RadzenYearView and override the Next. Is this a requirement too? if yes what parameters should be in?

public override async Task SetParametersAsync(ParameterView parameters)
{
    if (parameters.DidParameterChange("Text", Text) && Scheduler != null)
    {
        await Scheduler.Reload();
    }

    await base.SetParametersAsync(parameters);
    await Scheduler.AddView(this);
}

Hoping for your help. Thank you so much!

You forgot to mention what the error is.

No.

Ohhh i forgot to screenshot. here it is sir

image

this happens right when the component has rendered

Try debugging your application.