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

Nested Items within a PanelBar

3 Answers 372 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 03 Jun 2015, 02:24 AM

Hi

How do insert a control within a Panel.

As an example below with the Panel Getting Started I would have the text "Testing" and then a Kendo.button underneath ?

 

<h3>Telerik UI for ASP.NET MVC PanelBar</h3>
<br />
 
@(Html.Kendo().PanelBar()
    .Name("IntroPanelBar")
    .Items(items =>
    {
        items.Add()
            .Text("Getting Started")
            .Selected(true)
            .Expanded(true)
            .Content(@<text>
                Testing

    //button here

            </text>);
 
        items.Add()
            .Text("Add NuGet packages and jump-start your coding")
            .Content(@<text>
                <p style="padding:0 1em">NuGet makes it easy to install and update free libraries and tools.
                <a href="http://go.microsoft.com/fwlink/?LinkId=245153">Learn more…</a></p>
            </text>);
        items.Add()
            .Text("Find Web Hosting")
            .Content(@<text>
                <p style="padding:0 1em">You can easily find a web hosting company that offers the right mix of features
                and price for your applications.
                <a href="http://go.microsoft.com/fwlink/?LinkId=245157">Learn more…</a></p>
            </text>);
    })
)

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 04 Jun 2015, 02:29 PM
Hi Andrew,

Here is an example: 
.Items(panelbar =>
{
    panelbar.Add().Text("My Teammates")
        .Expanded(true)
        .Content(@<text>
                @Html.Kendo().Button().Name("myButton").Content("Click me")
        </text>);


Regards,
Alexander Popov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andrew
Top achievements
Rank 1
answered on 26 Jun 2015, 07:55 PM

The  .Content(@<text></text> works well but can it be used with panelBar.Append ?

 

 $("#panelbar").kendoPanelBar();
        var panelBar = $("#panelbar").data("kendoPanelBar");

        panelBar.append(

            {
                text: "New Person",
                encoded: true,
                content: "dddddddddddddddddddd"

                           
                
    }


0
Alexander Popov
Telerik team
answered on 30 Jun 2015, 12:00 PM
Hello Andrew,

You can append the panel first with an HTML element as its content, then use that element to initialize the button.

Regards,
Alexander Popov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PanelBar
Asked by
Andrew
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or