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

[Solved] Ajax Grid DropDownList display

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
GMR
Top achievements
Rank 2
GMR asked on 30 Jan 2012, 04:41 PM
I have an ajax bound grid that is working correctly using an editor template.

 When the user clicks edit or insert, the in line editor works as expected and the drop down list appears using a complex object.  The issue I'm having is that when the grid is in Display mode, the field is showing the Id of the drop down field and I need it to display the selected text.

example

cols.bound(c => c.IngredientId)

IngredientId has a UIHint that points to the editortemplate that displays the dropdown.

@model int
@(
    Html.Telerik().DropDownListFor(e => e).BindTo(new SelectList(ViewBag.IngredientList, "Id", "Name"))
)

After the insert or save the column in the grid displays the Id field and I need it to display the Name of the ingredient they selected... I'm assuming this is done with a displaytemplate, but I'm curious how to implement that...

thanks.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 31 Jan 2012, 11:34 AM
Hi,

Showing the text of the selected item can be done by:

Regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
GMR
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or