We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Display text value

Why my grid trying to display text value like date?

This is the recordsource list for the grid:


This is the definition of the grid:

@(Html.EJ().Grid<object>("gridP")
                .Datasource((IEnumerable<PolicaLista>)ViewBag.dsPolice)
                .AllowPaging()
                .PageSettings(p => { p.PageSizeList(new List<int>() { 12, 25, 50 }); })
                .ToolbarSettings(toolbar =>
                {
                    toolbar.ShowToolbar().ToolbarItems(items =>
                    {
                        items.AddTool(ToolBarItems.ExcelExport);
                        items.AddTool(ToolBarItems.Search);
                    });

                })
                .AllowScrolling(true)
                .ScrollSettings(scroll => { scroll.Width("auto"); })
                .Locale("hr-HR")
                .AllowSorting(true)
                .AllowFiltering(true)
                .AllowTextWrap(true)
                .EnableTouch(true)
                .FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
                .Columns(col =>
                {
                    col.Field("PolicaID").HeaderText("PolicaID").IsPrimaryKey(true).Visible(false).Add();
                    col.HeaderText("").Format("<a rel='nofollow' href='#'><img onclick='obnoviPolicu({PolicaID},\"" + "{BrojPolice}" + "\");' src='" + Url.Content("~/Images/obnova.png") + "' title='Obnovi policu'></a>").Width(40).Add();
                    col.HeaderText("").Template("#tmplOsigKuca").Width(40).Add();
                    col.Field("BrojPolice").HeaderText("Broj police").Width(150).Add();
                    col.Field("DatumOd").HeaderText("Početak").Format("{0:dd.MM.yyyy.}").Type("date").Width(100).Add();
                    col.Field("DatumDo").HeaderText("Kraj").Format("{0:dd.MM.yyyy.}").Type("date").Width(100).Add();
                    col.Field("Ugovaratelj").HeaderText("Ugovaratelj").Width(150).Add();
                    col.Field("Osiguranik").HeaderText("Osiguranik").Width(150).Add();
                    col.Field("Proizvod").HeaderText("Proizvod").Width(200).Add();
                    col.Field("Valuta").HeaderText("Valuta").Width(75).TextAlign(TextAlign.Center).HeaderTextAlign(TextAlign.Center).Add();
                    col.Field("Premija").HeaderText("Premija").TextAlign(TextAlign.Right).Format("{0:N2}").Width(100).Add();
                    col.Field("Registracija").HeaderText("Registracija").Width(130).Add();
                    col.Field("Djelatnik").HeaderText("Djelatnik").Width(170).Add();
                    col.Field("Suradnik").HeaderText("Suradnik").Width(170).Add();
                    col.Field("Kontakt").HeaderText("Kontakt").Width(170).Add();
                    col.Field("DatumIzdrade").HeaderText("Dat.izrade").Format("{0:dd.MM.yyyy.}").Type("date").Width(120).Add();
                }).ClientSideEvents(ev => ev.Load("load"))
)

And this is the results on the page:



I'm using this version



Thanks!
Bernard.

3 Replies

PK Padmavathy Kamalanathan Syncfusion Team August 27, 2019 10:19 AM

Hi Bernad, 
 
Thanks for contacting Syncfusion Forum. 
 
QUERY: Display Text Value 
 
From your query we understand that you are getting invalid date error for column which is not a date column. 
 
To avoid the issue, we suggest you to use the below solution. 
 
 
<script type="text/javascript"> 
         
    ej.dateParse = false; 
     
</script> 
 
 
 
If you have further queries, please get back us. 
 
Regards, 
Padmavathy Kamalanathan 



BJ Bernard Jurlina August 27, 2019 12:43 PM

Hi Padmavathy,

yes, it's working fine with your suggestion. Thank you.

Regards,
Bernard.



PK Padmavathy Kamalanathan Syncfusion Team August 27, 2019 11:11 PM

Hi Bernard, 

We are happy to hear that your issue has been resolved. 

Feel free to get back to us if you need further assistance. 

Regards, 
Padmavathy Kamalanathan 


Loader.
Live Chat Icon For mobile
Up arrow icon