ComboBoxFor not displaying combo when Iframe true

2 posts, 1 answers
  1. Russ
    Russ avatar
    6 posts
    Member since:
    Apr 2014

    Posted 20 Jun 2014 Link to this post

    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.

    @helper NewProspectWorkflowProject()
        .Title("Add new project")
        .Content("loading user info...")
        .LoadContentFrom("AddProject", "ProspectWorkflow")


    <span id="undo" class="k-button">Click here to open the window.</span>

    $(document).ready(function() {
    .bind("click", function() {


    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())


           <div class="editor-label">
                   @Html.LabelFor(model => model.projectID)
                  @(Html.Kendo().ComboBoxFor(model => model.projectID)
                              .HtmlAttributes(new { style = "width:250px", id = "client_name_dropdown2" })
                               .DataSource(source =>        
                                    source.Read(read =>
                                         read.Action("GetClientNames", "ComboBox");
                @Html.ValidationMessageFor(model => model.projectID)

    Thank you,

  2. Answer
    Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 24 Jun 2014 Link to this post

    Hello Russ,

    When using an iframe, the kendo scripts should be added again inside the partial view (if you are returning just a partial view without the layout), because the scripts that are registered on the main page (that contains the window) are not available within the iframe and the combobox cannot be initialized.

    Kind Regards,
    Petur Subev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top