Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8600475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:37:31+00:00 2026-06-12T01:37:31+00:00

My application is asp.net MVC, trying to bind a Telerik MVC Combobox to a

  • 0

My application is asp.net MVC, trying to bind a Telerik MVC Combobox to a model.
Here is the model:

public class Person
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public bool DisplayBold { get; set; }
        public string Value
        {
            get
            {
                return string.Format("{0}|{1}", this.Id, this.DisplayBold.ToString());
            }
        }
    }

In the controller:

  var people = new List<Person>();
        people.Add(new Person { Id = 1, Name = "John Doe", DisplayBold = true });
        people.Add(new Person { Id = 2, Name = "Jayne Doe", DisplayBold = false });
        ViewData["people"] = people;
        return View();

I do get the values.

In the view:

<%= Html.Telerik().ComboBox()
       .Name("ComboBox")
           .BindTo((IEnumerable<SelectListItem>)ViewData["people"])
%>

I get the follwing error:

Unable to cast object of type 'System.Collections.Generic.List`1[caseprog.Models.Person]' to type 'System.Collections.Generic.IEnumerable`1[System.Web.Mvc.SelectListItem]'.

I would appreciate your suggestions. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:37:32+00:00Added an answer on June 12, 2026 at 1:37 am

    You can’t just cast a List of People to a IEnumerable of SelectListItem. They’re two different things.

    Instead, you need to convert the list to a list of SelectListItem. You can do that in a number of ways, but this one should work:

    .BindTo(new SelectList((IEnumerable<Person>)ViewData["people"], "Id", "Name"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to save an image like this (from an asp.net mvc application): public
my application is asp.net MVC, using Telerik MVC charts. I am trying to hide
I'm trying to write a web application in ASP.NET MVC that allows each user
In my ASP.NET MVC application, I'm trying to figure out whether the user has
I'm trying to create ASP.NET MVC Application with Entity Framework, which has One to
I'm trying to write an ASP.NET MVC application where user privilege is based upon
I am trying to upload an ASP.NET MVC application in a shared server running
I'm trying to run an ASP.NET MVC 2 web application under IIS on Windows
I am using JW Player in an ASP.NET MVC application and I'm trying to
I have a form within an ASP.NET MVC application and I'm trying to submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.