Nested Items within a PanelBar

4 posts, 1 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Sep 2012

    Posted 02 Jun 2015 Link to this post

    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>);
        })
    )

     

  2. Answer
    Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 04 Jun 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Andrew
    Andrew avatar
    4 posts
    Member since:
    Sep 2012

    Posted 26 Jun 2015 in reply to Alexander Popov Link to this post

    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"

                               
                    
        }


  5. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 30 Jun 2015 Link to this post

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