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

[Solved] Combo desplaying model class name

0 Answers 14 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hector
Top achievements
Rank 1
Hector asked on 01 Jul 2011, 12:41 AM
Im using a combo, but when i click on it, the combo shows the class's name (SACC.Models.Forms.ComboBoxPais),the other is ok, show the list correctly after click.

This is the view code:

            @(Html.Telerik().ComboBox()
            .Name("ComboPais")
            .SelectedIndex(-1)
            .BindTo(new SelectList(Model.combopais.Paises, "ID", "NombrePais"))
            .ClientEvents(events => events.OnChange("onPaisChange"))
            )

action code:

        public ActionResult NuevoClienteNacional()
        {
            model.combopais.Paises = dbPais.Pais.ToList();
            return View(model);
        }

Class

namespace SACC.Models.Forms
{
    public class IngresoClienteNacional
    {
        public Cliente  cliente { get; set; }
        public ComboBoxPais combopais { get; set; }

        public IngresoClienteNacional()
        {
            cliente = new Cliente();
            combopais = new ComboBoxPais();
        }
    }

    public class ComboBoxPais
    {
        public ComboBoxPais()
        {
            Paises = new List<Pais>();
        }
        public IEnumerable<Pais> Paises
        {
            get;
            set;
        }
    }

}

Please help me im new using telerik.

Thank you and sorry for my english

Tags
ComboBox
Asked by
Hector
Top achievements
Rank 1
Share this question
or