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
close icon

Grid with Datepicker globalization

Hello, i'm doing a grid in MVC with datepicker column and i need to show the date in format: dd/MM/yyyy.

I translated the file ej.culture.pt-BR.min to do this, however, when i enter in edit mode, the input is in English format: MM/dd/yyyy.

The grid:

@(Html.EJ().Grid<ViewModel>("GridName")
        .Datasource(ds => ds.Json((IEnumerable<ViewModel>)Model.ViewModel)
        ...
        .Adaptor(AdaptorType.RemoteSaveAdaptor))
            .EditSettings(edit =>
            {
                edit.AllowAdding().
                AllowDeleting().
                ShowDeleteConfirmDialog(false).
                AllowEditing();
            })
        .AllowKeyboardNavigation(false)
        .Locale("pt-BR")
        .ToolbarSettings(tool =>
        {
            tool.ShowToolbar().ToolbarItems(x =>
            {
                x.AddTool(ToolBarItems.Add);
                x.AddTool(ToolBarItems.Edit);
                x.AddTool(ToolBarItems.Delete);
                x.AddTool(ToolBarItems.Update);
                x.AddTool(ToolBarItems.Cancel);
            });
        })
        .AllowPaging()
        .PageSettings(Page => { Page.PageSize(5); })
        .Columns(col =>
        {
            col.Field("Id").IsPrimaryKey(true).IsIdentity(true).Visible(false).Add();            
            col.Field("Date").HeaderText(Resource.GridHeader_Date).Width(15).TextAlign(TextAlign.Right).EditType(EditingType.Datepicker).AllowEditing(true).Format("{0:dd/MM/yyyy}").ValidationRules(v => v.AddRule("required", true).AddRule("messages", "{required:'" + Resource.Message_RequiredField + "'}")).CssClass("fontSize11").Add();


Obs.: i'm importing the file ej.culture.pt-BR.min in head section.

The ej.culture.pt-BR.min and pictures of grid are attached.

And i need to translate the Excel Filter of grid, how can i do this?

Attachment: Files_4f138745.zip

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team September 16, 2016 12:35 PM UTC

Hi Marlon, 

Thanks for contacting Syncfusion support. 

We were unable to reproduce the reported issue at our end. We have included your culture and created a sample. Please kindly refer to the sample that can be download from following link, 

If you still face the same issue, then could you please share the following details? 
1)      Essential studio version details. 
2)      Scenario for replication procedure. 
3)      A sample if possible or modify the given sample as issue reproducible. 
You can change the excel filter culture like below, 

<Excel Filter culture file> 
ej.ExcelFilter.Locale["default"] = ej.ExcelFilter.Locale["pt-BR"] = { 
        SortNoSmaller: "Sort Smallest to Largest",  //You can replace the culture valure instead of defaults 
        SortNoLarger: "Sort Largest to Smallest",   //You can replace the culture valure instead of defaults 
        SortTextAscending: "Sort A to Z",           //You can replace the culture valure instead of defaults 
        SortTextDescending: "Sort Z to A",          //You can replace the culture valure instead of defaults 
        SortDateOldest: "Sort by Oldest",           //You can replace the culture valure instead of defaults 
        SortDateNewest:"Sort by Newest",            //You can replace the culture valure instead of defaults 
            SortByColor: "Sort By Color",               //You can replace the culture valure instead of defaults 
        SortByCellColor: "Sort by Cell Color",      //You can replace the culture valure instead of defaults 
        SortByFontColor: "Sort by Font Color",      //You can replace the culture valure instead of defaults 
        FilterByColor: "Filter By Color",           //You can replace the culture valure instead of defaults 
            CustomSort: "Custom Sort",                  //You can replace the culture valure instead of defaults 
        FilterByCellColor: "Filter by Cell Color",  //You can replace the culture valure instead of defaults 
        FilterByFontColor: "Filter by Font Color",  //You can replace the culture valure instead of defaults 
        ClearFilter: "Clear Filter",                //You can replace the culture valure instead of defaults 
        NumberFilter: "Number Filters",             //You can replace the culture valure instead of defaults 
            GuidFilter: "Guid Filters",                 //You can replace the culture valure instead of defaults 
        TextFilter: "Text Filters",                 //You can replace the culture valure instead of defaults 
        DateFilter: "Date Filters",                 //You can replace the culture valure instead of defaults 
        DateTimeFilter: "Date Time Filters",        //You can replace the culture valure instead of defaults 
        SelectAll: "Select All",                    //You can replace the culture valure instead of defaults 
        Blanks: "Blanks",                           //You can replace the culture valure instead of defaults 
            Search:"Search",                            //You can replace the culture valure instead of defaults 
        Showrowswhere:"Show rows where",            //You can replace the culture valure instead of defaults 
            NumericTextboxWaterMark:"Enter value",      //You can replace the culture valure instead of defaults 
        StringMenuOptions: [{ text: "Equal", value: "equal" }, { text: "Not Equal", value: "notequal" }, { text: "Starts With", value: "startswith" }, { text: "Ends With", value: "endswith" }, { text: "Contains", value: "contains" }, { text: "Custom Filter", value: "customfilter" }], 
        NumberMenuOptions: [{ text: "Equal", value: "equal" }, { text: "Not Equal", value: "notequal" }, { text: "Less Than", value: "lessthan" }, { text: "Less Than Or Equal", value: "lessthanorequal" }, { text: "Greater Than", value: "greaterthan" }, { text: "Greater Than Or Equal", value: "greaterthanorequal" }, { text: "Between", value: "between" }, { text: "Custom Filter", value: "customfilter" }], 
        GuidMenuOptions: [{ text: "Equal", value: "equal" }, { text: "Not Equal", value: "notequal" }, { text: "Custom Filter", value: "customfilter" }], 
            DateMenuOptions: [{ text: "Equal", value: "equal" }, { text: "Not Equal", value: "notequal" }, { text: "Less Than", value: "lessthan" }, { text: "Less Than Or Equal", value: "lessthanorequal" }, { text: "Greater Than", value: "greaterthan" }, { text: "Greater Than Or Equal", value: "greaterthanorequal" }, { text: "Between", value: "between" }, { text: "Custom Filter", value: "customfilter" }], 
            DatetimeMenuOptions: [{ text: "Equal", value: "equal" }, { text: "Not Equal", value: "notequal" }, { text: "Less Than", value: "lessthan" }, { text: "Less Than Or Equal", value: "lessthanorequal" }, { text: "Greater Than", value: "greaterthan" }, { text: "Greater Than Or Equal", value: "greaterthanorequal" }, { text: "Between", value: "between" }, { text: "Custom Filter", value: "customfilter" }], 
            Top10MenuOptions: [{ text: "Top", value: "top" }, { text: "Bottom", value: "bottom" }], 
            title: "Custom Filter",                           //You can replace the culture valure instead of defaults 
            PredicateAnd: "AND",                             //You can replace the culture valure instead of defaults 
            PredicateOr: "OR",                               //You can replace the culture valure instead of defaults 
            Ok: "OK",                                        //You can replace the culture valure instead of defaults 
            MatchCase: "Match Case",                         //You can replace the culture valure instead of defaults 
            Cancel: "Cancel",                                //You can replace the culture valure instead of defaults 
            NoResult: "No Matches Found",                    //You can replace the culture valure instead of defaults 
            CheckBoxStatusMsg: "Not all items showing",      //You can replace the culture valure instead of defaults 
            DatePickerWaterMark: "Select date",              //You can replace the culture valure instead of defaults 
            DateTimePickerWaterMark: "Select date time",     //You can replace the culture valure instead of defaults 
            True: "true", //You can replace the culture valure instead of defaults 
            False: "false"//You can replace the culture valure instead of defaults 
    }; 

Regards, 
Venkatesh Ayothiraman. 


Loader.
Live Chat Icon For mobile
Up arrow icon