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

Column value chaning COMMA to DOT

Hi,

Here is my current code inside my grid:

col.Field("CUPOM").HeaderText("Juros %").Format("{0:n}").EditType(EditingType.Numeric).Width(100).NumericEditOptions(new Syncfusion.JavaScript.Models.EditorProperties() { DecimalPlaces = 2, MaxValue = 99999999.99, Locale = "pt-BR", MinValue = 0 }).Add();

When I change the value (e.g. 2,67 to 3,07) it's changes by itself to 3.07.

Someone know how to figure it out?

Thanks in advance.

3 Replies

JK Jayaprakash Kamaraj Syncfusion Team December 11, 2015 11:04 AM UTC

Hi Carlos,
Thanks for contacting Syncfusion support.
We have analyzed your issue. We were able to reproduce the issue when not mentioning localization in the grid. We suspect that you did not set Locale to grid. So, we suggest that you set Locale to the grid. Please refer to the below Code Example and Sample.
Code Example:

@(Html.EJ().Grid<SyncfusionMvcApplication23.OrdersView>("FlatGrid")

        .Datasource((IEnumerable<object>)ViewBag.datasource)

        .AllowScrolling()

         .AllowPaging()

                        .Locale("pt-BR")

         /*Paging Enabled*/

              .EditSettings(edit=>{edit.AllowAdding().AllowDeleting().AllowEditing(); })

              .ToolbarSettings(toolbar =>

                {

                 toolbar.ShowToolbar().ToolbarItems(items =>

                 {

                  items.AddTool(ToolBarItems.Add);

                  items.AddTool(ToolBarItems.Edit);

                  items.AddTool(ToolBarItems.Delete);

                  items.AddTool(ToolBarItems.Update);

                  items.AddTool(ToolBarItems.Cancel);

                });

              })

        .Columns(col =>

        {

            col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();

            col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();

            col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(75).Add();

            //col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add();

            col.Field("Freight").HeaderText("Freight").Format("{0:n}").EditType(EditingType.Numeric).Width(100).NumericEditOptions(new Syncfusion.JavaScript.Models.EditorProperties() { DecimalPlaces = 2, MaxValue = 99999999.99, Locale = "pt-BR", MinValue = 0 }).Add();
        }))


Sample: http://www.syncfusion.com/downloads/support/forum/121402/ze/SyncfusionMvcApplication23-1710670067
After setting Locale to the Grid, if you still face any issue, please share the following information to find out the cause of the issue and provide an appropriate solution.


1.       Are you using any Adaptors?

2.       Any script throws in console?

3.       Please tell me the value changing comma to dot while editing or after updating?

4.       If possible, please share your issue reproducible sample or change the given sample to issue reproducible.

Regards,
Jayaprakash K.



CM Carlos Mattos December 11, 2015 11:56 AM UTC

Hi Jayaprakash,

Thanks for you reply, follow below my current code:

@(Html.EJ().Grid<EventsDebentureModel>("grdFinancialEvents").Datasource(ds => ds.Json(Model.Debenture.Events).BatchURL(@Url.Action("/UpdateFinancialEvents"))
                            .Adaptor(AdaptorType.RemoteSaveAdaptor))
                            .AllowSorting(false)
                            .AllowFiltering()
                            .AllowMultipleExporting()
                            .Locale("pt-BR")
                            .EditSettings(e =>
                            {

                                e.AllowDeleting(true);
                                e.AllowEditing(true);
                                e.AllowEditOnDblClick(true).EditMode(EditMode.Batch).ShowConfirmDialog(false).ShowDeleteConfirmDialog(false);

                            })
                            .Columns(col =>
                            {
                                col.Field("FinancialEventId").Visible(false).Add();
                                col.Field("DEVENTO").Format("{0:dd/MM/yyyy}").HeaderText("Data").EditType(EditingType.Datepicker).Width(130).Add();
                                col.Field("BCALC").HeaderText("Base de Cálculo").EditType(EditingType.Dropdown).ForeignKeyField("Id").ForeignKeyValue("Description").DataSource((IEnumerable<DomainTableMessage>)ViewBag.GRID_BCALC).TextAlign(TextAlign.Left).Width(100).Add();
                                col.Field("TJUROS").HeaderText("Tipo de Juros").EditType(EditingType.Dropdown).ForeignKeyField("Id").ForeignKeyValue("Description").DataSource((IEnumerable<DomainTableMessage>)ViewBag.GRID_TJUROS).TextAlign(TextAlign.Left).Width(100).Add();
                                col.Field("AMORT").HeaderText("Amortização %").Format("{0:n}").EditType(EditingType.Numeric).Width(100).NumericEditOptions(new Syncfusion.JavaScript.Models.EditorProperties() { DecimalPlaces = 4, MaxValue = 999999.9999, Locale = "pt-BR", MinValue = 0 }).Add();
                                col.Field("CORRECAO").HeaderText("Correção %").Format("{0:n}").Width(100).EditType(EditingType.Numeric).NumericEditOptions(new Syncfusion.JavaScript.Models.EditorProperties() { DecimalPlaces = 2, MaxValue = 9999.99, Locale = "pt-BR", MinValue = 0 }).Add();
                                col.Field("CUPOM").HeaderText("Juros %").Format("{0:n}").EditType(EditingType.Numeric).Width(100).NumericEditOptions(new Syncfusion.JavaScript.Models.EditorProperties() { DecimalPlaces = 2, MaxValue = 99999999.99, Locale = "pt-BR", MinValue = 0 }).Add();
                                col.Field("DREPAC").Format("{0:dd/MM/yyyy}").EditType(EditingType.Datepicker).HeaderText("Repactuação").Width(100).Add();
                            })
                            .EnableAltRow()
                                    .AllowScrolling(true)
                                    .ScrollSettings(scroll => { scroll.AllowVirtualScrolling(false).Width(960).Height(400).VirtualScrollMode(VirtualScrollMode.Continuous); })
                            .AllowFiltering()
                            .AllowSorting()
.ClientSideEvents(cli=>cli.ActionComplete("instrument_form.OnActionCompleteFinancialEvents"))
                            )


Still getting the same issue.

Any thoughts?

Thanks in advance.


JK Jayaprakash Kamaraj Syncfusion Team December 14, 2015 10:32 AM UTC

Hi Carlos,

Please follow the incident that has been created under your account to track the status of this requirement. Please log on to our support website to check further updates. 
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Regards,
Jayaprakash K.


Loader.
Live Chat Icon For mobile
Up arrow icon