How to change DatePicker Min and Max properties on the fly

I do not have a clue on the correct way to change DatePicker Min and Max properties on the fly.


1 Reply 1 reply marked as answer

DR Deepak Ramakrishnan Syncfusion Team August 11, 2022 09:08 AM UTC

Hi Roberto,


Greetings …!


Yes you can change the Min and Max property value dynamically as like below code . Kindly get back to us if you need further assistance on this.



@using Syncfusion.Blazor.Calendars

 

 

<SfDatePicker TValue="DateTime?" Min="@mindate" Max="@maxdate"></SfDatePicker>

<br />

<br />

<button @onclick="click">Click Me</button>

 

@code{

 

    public DateTime mindate = new DateTime(2022,8,11);

    public DateTime maxdate = new DateTime(2022,8,31);

 

    public void click()

    {

        mindate = new DateTime(2022,7,1);

        maxdate = new DateTime(2022,7,31);

    }

 

}

 




Thanks,

Deepak R.


Marked as answer
Loader.
Up arrow icon