This question is locked. New answers and comments are not allowed.
I can get the generic Html.Dropdownlist to display but not the Telerik extension.
Here's some Telerik attempts which don't:
(This displays nothing)
(This one will display the 2nd option, but has none of the other values available.)
(This one errors saying does not contain a property with the name 'clientid')
Any suggestions to get the SelectList from the ViewBag to display?
Thanks,
-Sid.
Here's the line that works:
@Html.DropDownList("clientid", (SelectList)ViewBag.Clients, "Select Client")
Here's some Telerik attempts which don't:
@(Html.Telerik().DropDownList()
.Name("ClientList")
.BindTo(new SelectList(ViewBag.Clients))
.Enable(true))
@(Html.Telerik().DropDownList()
.Name("ClientList")
.BindTo(new SelectList(ViewBag.Clients,"Value","Text",2))
.Enable(true)
@(Html.Telerik().DropDownList()
.Name("ClientList")
.BindTo(new SelectList(ViewBag.Clients,"cliendid","clientname",2))
.Enable(true)
Any suggestions to get the SelectList from the ViewBag to display?
Thanks,
-Sid.
6 Answers, 1 is accepted
0
Hello Sid,
Regards, Atanas Korchev
the Telerik team
Have you tried the same approach which you are using for the dropdownlist? Something like this:
@(Html.Telerik().DropDownList()
.Name("ClientList")
.BindTo((SelectList)ViewBag.Clients)
Regards, Atanas Korchev
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
0

Sid
Top achievements
Rank 1
answered on 03 Nov 2011, 04:53 PM
Yes, that was one of the things I'd tried. That just displayed the first item in the list, with no options.
I've attached the two screen shots.
Here is the razor view code:
<td
>@Html.DropDownList("clientid", (SelectList)ViewBag.Clients, "Select Client")
</
td
>
@*<
td
>*@
@*@(Html.Telerik().DropDownList()*@
@*.Name("ClientList")*@
@*.BindTo((SelectList)ViewBag.Clients)*@
@*)*@
@*</
td
>*@
-Sid.
0
Hello Sid,
All the best,
Georgi Krustev
the Telerik team
Unfortunately, this functionality is not currently supported. Nevertheless you can easy implement it by modifying the list of the Clients:
@{
var list = ViewBag.Clients
as
List<SelectListItem>;
list.Insert(0,
new
SelectListItem { Text =
"Select item"
});
}
Georgi Krustev
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
0

Sid
Top achievements
Rank 1
answered on 04 Nov 2011, 02:18 PM
I guess you just lost me. I'm just trying to get the DropDownList to display my client list from the the ViewBag. If you are referring to the ability to add the "Select a Client" option at the top of the list, that is totally secondary to just getting the list to display.
The Telerik dropdown will only display the single item which is the first one in the list. It isn't building the <li> options from "ViewBag.Clients".
I'm hoping to eventually tie the client dropdown list to cascade to fill the "Journey Role" list.
Thanks,
-Sid.
The Telerik dropdown will only display the single item which is the first one in the list. It isn't building the <li> options from "ViewBag.Clients".
I'm hoping to eventually tie the client dropdown list to cascade to fill the "Journey Role" list.
Thanks,
-Sid.
0
Hello Sid,
Georgi Krustev
the Telerik team
Please excuse me for the misunderstanding. I have used the shared code snippets to prepare a test project, which is attached to this message. Everything seems to be OK on my end.
Georgi Krustev
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
0

Roman
Top achievements
Rank 1
answered on 17 Apr 2012, 10:49 PM
Looks to me that the project is outdatad. Could someone update the database to version 662 please?