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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Display text value

Thread ID:

Created:

Updated:

Platform:

Replies:

146950 Aug 26,2019 06:54 PM UTC Aug 28,2019 04:11 AM UTC ASP.NET MVC 3
loading
Tags: Grid
Bernard Jurlina
Asked On August 26, 2019 06:54 PM UTC

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.

Padmavathy Kamalanathan [Syncfusion]
Replied On August 27, 2019 03:19 PM UTC

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 


Bernard Jurlina
Replied On August 27, 2019 05:43 PM UTC

Hi Padmavathy,

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

Regards,
Bernard.


Padmavathy Kamalanathan [Syncfusion]
Replied On August 28, 2019 04:11 AM UTC

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon