Hi
May last question of the year. I promise! I really don't ask for help much for a long time user.
For my MVC scheduler edit popup I use a CustomEditorTemplate.cshtml because I added 2 extra fields. Nice!
In that file I use the code below for my OwnerID dropdownlist which usually has 8 items.
However, I oftem limit the dropdownlist to only one item when I know the user is filtered to one OwnerID.
So I want the dropdown list to only have that one OwnerID in it automatically selected. But... for some reason a blank row is at the top of the DDL so the user has to manually select the only one item. I don't use .OptionLabel("xxx"). How can I get rid of the empty row at the top and make this work?
I can't switch to another ddl control because I need .Data("filterdata") to pass parameters to.
Thanks
<
div
data-container-for
=
"OwnerID"
class
=
"k-edit-field"
>
@(Html.Kendo().DropDownListFor(model => model.OwnerID)
.HtmlAttributes(new { data_bind = "value:OwnerID", style = "width: 300px" })
.DataTextField("Text")
.DataValueField("Value")
.ValuePrimitive(true)
.Template("<
span
class
=
'k-scheduler-mark'
style
=
'background-color:\\#= data.Color?Color:'
' \\#'></
span
>\\#=Text\\#")
.DataSource(ds => ds
.Read(read => read
.Action("GetDepartmentListx", "Scheduler")
.Data("filterdata") // in index page this function passes checkbox data parameters
))
)
</
div
>