I've spent a couple hours and solved my issue, I think. If Iframe is true, the Kendo UI Widget is not working as a combobox. If Iframe is false, it works. Should I be using Iframe true or false, just not sure why I would care unless a browser does not allow them. Please explain the difference.
I have a View using the Window and loading content for a partial view and cannot get the ComboBoxFor to show a combobox, it only shows a text box.
I'm showing my View and PartialView below. Any ideas? I see in debugger the exact same combobox with a different ID, working perfectly but then the Window is loaded into an iFrame and does not work.
//View
@helper NewProspectWorkflowProject()
{
@(Html.Kendo().Window()
.Name("window")
.Width(630)
.Height(650)
.Title("Add new project")
.Content("loading user info...")
.LoadContentFrom("AddProject", "ProspectWorkflow")
.Iframe(true)
.Draggable()
.Resizable()
)
<span id="undo" class="k-button">Click here to open the window.</span>
<script>
$(document).ready(function() {
$("#undo")
.bind("click", function() {
$("#window").data("kendoWindow").open();
});
});
</script>
}
//PartialView
@{
Layout = null;
}
@model OperationsSite.Models.ProspectWorkflowProject
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>ProspectWorkflowProject2</legend>
<div class="editor-label">
@Html.LabelFor(model => model.projectID)
</div>
<div>
@(Html.Kendo().ComboBoxFor(model => model.projectID)
.Name("client_name_dropdown2")
.HtmlAttributes(new { style = "width:250px", id = "client_name_dropdown2" })
.SelectedIndex(0)
.Suggest(true)
.Filter("contains")
.AutoBind(false)
.DataTextField("DisplayValue")
.DataValueField("Value")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetClientNames", "ComboBox");
})
.ServerFiltering(true);
})
)
@Html.ValidationMessageFor(model => model.projectID)
</div>
Thank you,
Russ
I have a View using the Window and loading content for a partial view and cannot get the ComboBoxFor to show a combobox, it only shows a text box.
I'm showing my View and PartialView below. Any ideas? I see in debugger the exact same combobox with a different ID, working perfectly but then the Window is loaded into an iFrame and does not work.
//View
@helper NewProspectWorkflowProject()
{
@(Html.Kendo().Window()
.Name("window")
.Width(630)
.Height(650)
.Title("Add new project")
.Content("loading user info...")
.LoadContentFrom("AddProject", "ProspectWorkflow")
.Iframe(true)
.Draggable()
.Resizable()
)
<span id="undo" class="k-button">Click here to open the window.</span>
<script>
$(document).ready(function() {
$("#undo")
.bind("click", function() {
$("#window").data("kendoWindow").open();
});
});
</script>
}
//PartialView
@{
Layout = null;
}
@model OperationsSite.Models.ProspectWorkflowProject
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>ProspectWorkflowProject2</legend>
<div class="editor-label">
@Html.LabelFor(model => model.projectID)
</div>
<div>
@(Html.Kendo().ComboBoxFor(model => model.projectID)
.Name("client_name_dropdown2")
.HtmlAttributes(new { style = "width:250px", id = "client_name_dropdown2" })
.SelectedIndex(0)
.Suggest(true)
.Filter("contains")
.AutoBind(false)
.DataTextField("DisplayValue")
.DataValueField("Value")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetClientNames", "ComboBox");
})
.ServerFiltering(true);
})
)
@Html.ValidationMessageFor(model => model.projectID)
</div>
Thank you,
Russ