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

adding new record with null value in numeric cell

1 Answer 601 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rafi
Top achievements
Rank 1
rafi asked on 15 Jul 2014, 04:20 PM

Hi,

I use kendo grid with number type column.
when adding new record, the numeric field gets automatically value 0.
I want to set  this field as empty by default and not as 0.
Is there any way to do it?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 17 Jul 2014, 08:03 AM
Hi Rafi,

This could be done by specifying a defaultValue of null. For example: 
dataSource = new kendo.data.DataSource({
    transport: {
        ...
    },
    schema: {
        model: {
            id: "ProductID",
            fields: {
                ProductName: { type: "string" },
                UnitPrice: { type: "number", defaultValue: null },
            }
        }
    }
});


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