blank row

2 posts, 0 answers
  1. Louis
    Louis avatar
    56 posts
    Member since:
    Jun 2011

    Posted 03 Feb 2014 Link to this post


    How I can insert a blank row in a DropDownList

    controller :

    ViewBag.NoSource = new SelectList(db.Sources, "NoSource", "CodeSource");

    View :

        .Name("NoRisque") // Name of the widget should be the same as the name of the property
        .DataValueField("Value") // The value of the dropdown is taken from the EmployeeID property
        .DataTextField("Text") // The text of the items is taken from the EmployeeName property                                                       
        .BindTo((SelectList)ViewBag.NoSource) // A list of all employees which is populated in the controller                                                 

  2. Dimo
    Dimo avatar
    8406 posts

    Posted 04 Feb 2014 Link to this post

    Hello Louis,

    You need a data item with empty text, there is no other way.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top