How to handle null dates on Datagrid Column?

2 Answers 93 Views
Grid
Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
Wreeecks asked on 11 Jan 2022, 02:59 AM

I'm having issues in implementing date format on datagrid column. The problem is when the date is null it renders NaN/NaN/NaN. 

Is there way to customize this or at least hide the NaN when the date is null? TIA

 

here's my code

`<Column field="testDate" title="test date" filter="date" format="{0:dd/MM/yyyy}" />`

2 Answers, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 11 Jan 2022, 01:18 PM

Hello, Rex,

Thank you for reaching out to us. I made a runnable example using your code here:

https://stackblitz.com/edit/react-xtcsv2-b9yyqe?file=app/sample-products.jsx

It seems that the Grid renders empty cells instead of NaN, can you please provide a working example with your full code that reproduces this behavior?

Regards, FilipProgress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Filip
Telerik team
answered on 31 Jan 2022, 01:22 PM

Hi, Rex,

Can you provide a working example that reproduces the behavior or modify the one we provided? Since the shared code is only for the server and React is working on the client.

In general, rendering null values should result in an empty string.

Regards,
FilipProgress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Wreeecks
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Filip
Telerik team
Share this question
or