Error when adding DatePicker to a page!


NameValueType
Message"Object reference not set to an instance of an object."string


Now I get these errors anytime I put a DatePicker control on a page and run it.  Is it the DevExpress code? Do I need to keep them separate?

TIA,


Attachment: AddQuotation2_23c9c46.rar

8 Replies

MG Miles Gibson June 4, 2022 11:41 PM UTC

The problem is in the CalendarEvents part:


                    <SfDatePicker TValue="DateTime" @bind-Value="@QuotationDate" PlaceHolder="Choose a Date" >

                        <CalendarEvents TValue="DateTime" OnRenderDayCell="onRenderDayCellHandler"></CalendarEvents>

                    </SfDatePicker>


If I exclude this, then it works.



UD UdhayaKumar Duraisamy Syncfusion Team June 6, 2022 07:19 AM UTC

Hi Miles,


We suggest you use “DatePickerEvents instead of CalendarEvents in the DatePicker component to resolve the issue. Please refer to the below code snippet, sample, and documentation for more details.


<SfDatePicker TValue="DateTime" @bind-Value="@NewQuotation.QuotationDate" ShowClearButton="true"  >

                          <DatePickerEvents TValue="DateTime" OnRenderDayCell="onRenderDayCellHandler"></DatePickerEvents>

                    </SfDatePicker>


Please contact us if you require any further assistance on this.


Regards,

Udhaya Kumar D


Attachment: DatePicker_6024f2f9.zip


MG Miles Gibson June 6, 2022 02:13 PM UTC

Ok, I will try that.  You may want to update your documentation and sample source code then as well, that is where I got that from!


Cheers,


Miles



UD UdhayaKumar Duraisamy Syncfusion Team June 7, 2022 12:06 PM UTC

Hi Miles,


We can’t find the reported error in our documentation. If we missed we request you to share the error documentation link.


Please find the DatePicker Event documentation and API documentation below for reference.


Documentation : DatePicker Evnet - API


Regards,

Udhaya Kumar D.



MG Miles Gibson June 7, 2022 02:50 PM UTC



UD UdhayaKumar Duraisamy Syncfusion Team June 8, 2022 12:59 PM UTC

Hi Miles,


The share documentation is about the Syncfusion calendar component. The DatePicker is a separate component and please find the documentation for DatePicker.


Links :  Getting-Started  -  Special Dates-Online Demo


Regards,

Udhaya Kumar D.



MG Miles Gibson June 8, 2022 01:20 PM UTC

Got it, thanks!  Do you have any code for determining stat holidays?  For a future version, having this ability would be fantastic, but I am writing my own right now.  I will share when finished.


Cheers,

Miles



UD UdhayaKumar Duraisamy Syncfusion Team June 9, 2022 04:04 PM UTC

Hi Miles,


As we mentioned earlier you can customize the UI appearance of the date cell using RenderDayCell event and CSS stylings. If this does not meets your requirement kindly share the elaborated information about your requirement.


Regards,

Udhaya Kumar D.


Loader.
Up arrow icon