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

Change date format of Grid's datepicker in filter options

I have a Grid in which filtering is enabled. I want to change the date format of Grid's datepicker in filter to 'dd.MM.yyyy'. How can i change the date format of Grid's filter datepicker ?

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team May 15, 2019 12:32 PM UTC

Hi Abdul, 

Greetings from Syncfusion support. 

Based on your query we suspect that you want to change the date format for filter menu dialog in Grid. We can achieve your requirement by applying the format to the concern date column in Grid. 

Refer the below code example. 


@{ 
    object format; 
    format = new { type= "date", format= "dd.MM.yyy" }; 
} 
 
 
@Html.EJS().Grid("FlatGrid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col => 
{ 
    col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).Width("120").Add(); 
    col.Field("CustomerID").HeaderText("Customer Name").Add(); 
    col.Field("ShipCountry").HeaderText("Ship Country").Width("150").Add(); 
    col.Field("OrderDate").HeaderText("Order Date").Type("date").Format(format).Width("150").Add(); 
    col.Field("Freight").HeaderText("Freight").Width("120").Add(); 
}).AllowPaging().AllowFiltering().FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Menu); }).Render() 




Refer the below screens hot. 

 

Refer the help documentation. 


Regards, 
Thavasianand S. 



AW Abdul Wahab May 16, 2019 05:47 AM UTC

Getting the following error. 
CS1660: Cannot convert lambda expression to type 'object' because it is not a delegate type.


TS Thavasianand Sankaranarayanan Syncfusion Team May 17, 2019 11:27 AM UTC

Hi Abdul, 

We have prepared a sample with your mentioned requirement unfortunately we are unsuccessful to reproduce the issue. Sample can be downloadable from the below location.  


Please provide the following details for better assistance. 

  1. Share screen shot or video demonstration of the issue.
  2. Share the controller code and Grid rendering code example.
  3. If possible try to reproduce the issue in the attached sample.
  4. Share the Essential Studio version details.

Regards, 
Thavasianand S. 


Loader.
Up arrow icon