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

Selecting just-added record is not setting value in Select control

2 Answers 52 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bilal
Top achievements
Rank 2
Bilal asked on 10 Feb 2015, 02:07 PM
Hi,
In this example: http://dojo.telerik.com/OcifE/63

Click on "Add Row", fill in details, then click on "Add Product". 
Then, select the newly added product from the list, the editing form is not showing. With some debugging, the selectedProduct is not being set for newly created objects.

Any idea why?

Best regards
Bilal Haidar

2 Answers, 1 is accepted

Sort by
0
Bilal
Top achievements
Rank 2
answered on 10 Feb 2015, 08:27 PM
I figured out the problem. Since the item added has no ProductID value set, then it won't be treated as a Model object and hence won't be shown.

Any analysis why the behaviour is like that?

Regards
Bilal 
0
Daniel
Telerik team
answered on 12 Feb 2015, 11:57 AM
Hello Bilal,

The problem is not that there is no id but that the id and the dropdownlist value are equal to an empty string which is interpreted as no value. Setting ProductID to 0 when adding the item should resolve the problem.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Bilal
Top achievements
Rank 2
Answers by
Bilal
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or