Partialview in Kendo PanelBar

3 posts, 1 answers
  1. Anand Chua
    Anand Chua avatar
    5 posts
    Member since:
    Sep 2012

    Posted 27 Sep 2012 Link to this post

     Hi, I'm trying to fill a panel with the content of a partial view using the following :

    @(Html.Kendo().PanelBar()
            .Name("tPanelBarNavFolder")
            .ExpandMode(PanelBarExpandMode.Single)
            .HtmlAttributes(new { style = "width:300px" })
            .Items(panelbar =>
            {
                panelbar.Add().Text("My Folder")
                    .Expanded(true)
                    .Content(@<text> <div> abc @{ Html.RenderPartial("pvMyFolder", this.Model); } </div>
                    </text>);
                
                panelbar.Add().Text("Communication").Enabled(false);
            })

    The content of my partial view is <span>My Folder</span>.
    However the partial view is not within the content of My Folder. It shows outside the Panel bar.
    The above code working fine in Telerik MVC Extensions(superseded).
  2. Answer
    Beedoo
    Beedoo avatar
    4 posts
    Member since:
    Jun 2010

    Posted 28 Nov 2012 Link to this post

    Hi,

    I had the same issue and I've solved it using the Partial method instead of the RenderPartial method :

    panelbar.Add().Text("My Folder")
                    .Expanded(true)
                    .Content(@<text> <div> abc @Html.RenderPartial("pvMyFolder", this.Model)</div></text>);

    Hope this helps ;-)

    Julien CORIOLAND
  3. Kendo UI is VS 2017 Ready
  4. Anand Chua
    Anand Chua avatar
    5 posts
    Member since:
    Sep 2012

    Posted 29 Nov 2012 Link to this post

    Hi Beedoo ,

    Thanks for the help. It solve my problem.
Back to Top