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

nullable int in popup with combobox

2 Answers 237 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gusev
Top achievements
Rank 1
Gusev asked on 22 Mar 2013, 03:38 PM
Hello!
There is a problem with "int?" field in grid model. If popup editor has combobox in template, changes in combobox doesn't map to grid model (only if you Create item)
I made little example with fake data in all methods.
If you fire action "Student/Index", create new Item, fill form, click Update, when in action Student/Create you get the model with NULL in GroupId instead of selected value (value GroupId is not in FormValueProvider and on form selected value from ComboBox doesn't bind to $("#grid").getKendoGrid().editable.options.model)

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Iliev
Telerik team
answered on 26 Mar 2013, 10:09 AM
Hi Gusev,

 
I would suggest to check the "Binding Nullable field to DropDownList editor in Grid" demo in our CodeLibrary which demonstrates how to implement custom binding and disable the default value binding for a DropDownList(or ComboBox) in order to always set the value. This approach can be used to avoid the default value binding behavior to update the field with the selected item when the initial value is null.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Gusev
Top achievements
Rank 1
answered on 26 Mar 2013, 12:24 PM
Thank you for idea! I write changes directly to "kendoEditable" of window container to solve this problem. But you solution is really better.
Tags
Grid
Asked by
Gusev
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Gusev
Top achievements
Rank 1
Share this question
or