- Home
- Forum
- ASP.NET MVC - EJ 2
- Change date format of Grid's datepicker in filter options
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 ?
SIGN IN To post a reply.
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.
- Share screen shot or video demonstration of the issue.
- Share the controller code and Grid rendering code example.
- If possible try to reproduce the issue in the attached sample.
- Share the Essential Studio version details.
Regards,
Thavasianand S.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AW Abdul Wahab
- May 14, 2019 05:26 AM UTC
- May 17, 2019 11:27 AM UTC