Display date format

Hi,
in my grid I have a column Date.

<ejs-grid id="Grid" dataSource="@ViewBag.source">

    [...]

    <e-grid-columns>       

        <e-grid-column field="StartDate" headerText="Date" format="yMd" width="120"></e-grid-column>       

    </e-grid-columns>

</ejs-grid>


I want to display date with format dd/MM/yyyy. Is it possible? How?

Thanks



1 Reply

MF Mohammed Farook J Syncfusion Team September 28, 2018 05:47 AM UTC

Hi Mini, 
 
Thanks for contacting Syncfusion support. 
 
Yes you can set customize format in date column by using format property in grid load event. Please find the code example  
 
[index.cshtml]  
<div>   
    <ejs-grid id="Grid" dataSource="ViewBag.DataSource" load="load" allowPaging="true" >   
       <e-grid-columns>   
            ...   
            <e-grid-column field="OrderDate" headerText="Order Date" width="170"></e-grid-column>   
            ...   
       </e-grid-columns>   
    </ejs-grid>   
</div>   
   
<script>   
    function load(args) {   
        this.columns[3].format = { type: 'date', format: 'dd/MM/yyyy' };  // set your customize date format based on your column  
    }   
</script>   
  
  

Regards, 
J Mohammed Farook 


Loader.
Up arrow icon