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

DropDown in grid

2 Answers 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mina
Top achievements
Rank 1
mina asked on 02 Jun 2012, 10:30 AM
Hi
I use a dropdownList in a grid. data-text-field type is string and data-value-Field is (int).
grid shows a table that table has a foreign key (int ) . I wanted show data text in grid instead of int value . I did it .
when show data  in grid all thing work good. but when edit and change dropDown, then update record , grid don't show new value. How do I change value of this cell?

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 04 Jun 2012, 01:44 PM
Hi Mina,

To achieve this you could use the save event of the Kendo UI Grid and then update the text in the model. For example: 
save: function(e) {
   if (e.values['CategoryID']) {
       var text = $('#CategoryID').data('kendoDropDownList').text();
       e.model.Category = text;
   }
}

Also, I believe you may find this forum thread very useful - it discusses the same subject.

 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mina
Top achievements
Rank 1
answered on 05 Jun 2012, 04:51 AM
Thanks for reply Iliana
Tags
Grid
Asked by
mina
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
mina
Top achievements
Rank 1
Share this question
or