This is a migrated thread and some comments may be shown as answers.

Partialview in Kendo PanelBar

3 Answers 676 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Anand Chua
Top achievements
Rank 1
Anand Chua asked on 27 Sep 2012, 07:57 AM
 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).

3 Answers, 1 is accepted

Sort by
0
Accepted
Beedoo
Top achievements
Rank 1
answered on 28 Nov 2012, 03:33 PM
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
0
Anand Chua
Top achievements
Rank 1
answered on 30 Nov 2012, 04:12 AM
Hi Beedoo ,

Thanks for the help. It solve my problem.
0
td0rmx
Top achievements
Rank 1
answered on 24 Oct 2018, 03:02 PM
 @Html.Partial("TilesView") without Model did it for me, thanks :)
Tags
PanelBar
Asked by
Anand Chua
Top achievements
Rank 1
Answers by
Beedoo
Top achievements
Rank 1
Anand Chua
Top achievements
Rank 1
td0rmx
Top achievements
Rank 1
Share this question
or