Partial View and model kendo window

4 posts, 0 answers
  1. James
    James avatar
    18 posts
    Member since:
    Oct 2011

    Posted 01 Mar 2013 Link to this post

    Anyone get the kendo window to work with partial views?  I really enjoy MVC partial views for code resuse and readability, but Kendo windows don't give control back when they are modal.  Tried it two different ways: where the content is the partial view and where the partial view contains the kendo window.

    It also seems to screw up the other window on the page.  If I just have the one normal window, it works.  If I have both, they are both broken.  If I have just the partial view window, it doesn't work.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 05 Mar 2013 Link to this post

    Hello James,

    What exactly did you tried, could you share some code? 

    I tried the following and everything is working fine even with 4 windows:

    @(Html.Kendo().Window().Name("test1").Draggable().LoadContentFrom("TEST","Home"))
     
    @(Html.Kendo().Window().Name("test2").Draggable().LoadContentFrom("TEST","Home"))
     
     
    @{Html.Kendo().Window().Name("test3").Draggable().Content(@<text> @{Html.RenderPartial("TEST");} </text>).Render();}
     
    @{Html.Kendo().Window().Name("test4").Draggable().Content(@<text> @{Html.RenderPartial("TEST");} </text>).Render();}


    Kind regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Ezequiel
    Ezequiel avatar
    36 posts
    Member since:
    Oct 2011

    Posted 04 Apr 2014 in reply to Petur Subev Link to this post

    I just tried:
    <%= Html.Kendo().Window()
        .Name("WindowTransfer1")
        .Title("Window")
        .LoadContentFrom("TransferItems", "OrderForm")
        .Draggable()
        .Resizable()
    %>

    and 
    <%= Html.Kendo().Window()
        .Name("WindowTransfer1")
        .Title("Window")
        .Content(() => this.Html.RenderPartial("TransferItems", new FilterTransfer()))
        .Draggable()
        .Resizable()
    %>


    inside TransferItems.ascx I have only AAAA
    when I use the first option, it displays in the page I'm calling the Partial View.
    when I call the second option, it displays nothing in my window when I open it.









  5. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 08 Apr 2014 Link to this post

    Hello James,

    Based on the second demos that we have shared online, the ASPX syntax should look like this:

    <asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <% Html.Kendo().Window()
        .Name("window")   
        .Title("About Alvar Aalto")
        .Content(() =>
        {
            %>
            <div class="armchair">
                <% Html.RenderPartial("TransferItems", new FilterTransfer());  %>"
                         
            </div>
     
            <%
        })
        .Draggable()
        .Resizable()
        .Width(600)
        .Actions(actions => actions.Pin().Minimize().Maximize().Close())
        .Events(ev => ev.Close("onClose"))
        .Render();
    %>

    If this does not help, please put your case in a small sample project and send it so we can investigate further.

    Kind Regards,
    Petur Subev
    Telerik
     

    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
UI for ASP.NET MVC is VS 2017 Ready