This is a migrated thread and some comments may be shown as answers.

Currency format error at grid inline edit

1 Answer 231 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clovis Coli
Top achievements
Rank 1
Clovis Coli asked on 19 Feb 2013, 06:59 PM
I have a editable grid (inline) that contains a currency field, in pt-BR culture.

When I'm adding a new row, if I put the value 0,23 for example, and click Update, the grid now shows the value R$ 23,00.

How can I correct that bug? I've already checked if the culture script is set properly...

Here is my code (AdditionalPrice is the field)

var dataSource = new kendo.data.DataSource({
            transport: {
                read: "/Product/OptionGridRead",
                update: {
                    url: "/Product/OptionGridUpdate",
                    type: "POST"
                },
                destroy: {
                    url: "/Product/OptionGridDestroy",
                    type: "POST"
                },
                create: {
                    url: "/Product/OptionGridCreate",
                    type: "POST"
                }
            },
            schema: {
                model: {
                    id: "Id",
                    fields: {
                        Name: { validation: { required: true } },
                        AdditionalPrice: { type: "number", validation: { required: true } },
                        IsDefault: { type: "boolean" }
                    }
                }
            }
        });

        $("#grid").kendoGrid({
            height: 190,
            width: 200,
            dataSource: dataSource,
            toolbar: ["create"],
            columns: [
                { field: "Name", title: "Nome", editable: true },
                { field: "AdditionalPrice", title: "Valor Adicional", format: "{0:c2}", width: "150px" },
                { field: "IsDefault", title: "PadrĂ£o", width: "100px", template: '<input type="checkbox" name="IsDefault_#= id #" value="#= id #" id="IsDefault_#= id #" disabled="disabled" ${IsDefault==true?"checked":""} />'},
                { command: ["edit", "destroy"], title: " ", width: "210px" }],
            editable: {
                mode: "inline",
                createAt: "bottom"
            },
        });

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 21 Feb 2013, 02:26 PM
Hi Caue,

I am not sure where the problem comes from. I tested a similar scenario in this test page and got everything to work as expected. Could you please check my example and let me know what I am missing? The culture and field format are identical to the one from your code snippet.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Clovis Coli
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or