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

[Solved] How to set default selected value for dropdownlist in grid?

2 Answers 191 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.
Carl
Top achievements
Rank 1
Carl asked on 06 Apr 2011, 09:39 PM
I have experimented with a variety of different ways, but no success yet.

I've tried handling .ClientEvents(ce => ce.OnEdit("Grid_OnEdit")).

I've tried EditorTemplates for the View like

@(Html.Telerik().DropDownList()
        .Name("EntityTypeName")
        .BindTo(new SelectList((IEnumerable)ViewData["EntityTypeList"],ViewData["EntityTypeDefault"]))
)
but no luck.

Is there an example of MVC 3 Razor View of Grid that has columns with dropdownlists where the default selected value can be set for the initial default values of new rows necessary for insert of new row?

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 07 Apr 2011, 11:48 AM
Hello Carl,

 I have attached a small sample which demonstrates a possible way to preselect a default value of DropDownList component when inserting.

All the best,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Carl
Top achievements
Rank 1
answered on 08 Apr 2011, 06:56 AM
Thanks. I followed the approach in the sample, and was able to get it to work.
Tags
Grid
Asked by
Carl
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Carl
Top achievements
Rank 1
Share this question
or