How to add not null check in kendogrid client template
Microsoft Net Framework

Problem:
I have kendo grid mvc, for some record date is null, if we are parse  null date, it gives some incorrect result.
to avoid this issue, we sh'd parse date if date  is not null.

 

Solution:

How to add not null check in kendogrid client template

     columns.Bound(gridColumn.field).Title(gridColumn.caption). Visible(gridColumn.visible).Width(BusinessManager.GetColumnWidth(gridColumn.field, gridColumn.width)).ClientTemplate("#if("+ gridColumn.field + " != null){#" +
             "#="+ "kendo.toString(kendo.parseDate(" + gridColumn.field + "), '" + ConfigurationManager.AppSettings["DateFormattingValue"].ToString() + "')" + "#" +
             "#} else {#"+""+"# } #");

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM