Telerik Forums
UI for ASP.NET MVC Forum
2 answers
75 views

I am  using the PanelBar with Items Binding. I am LoadingContent on the Expansion of a Panel.  I would like to "refresh" or re load the content after a panel has been expanded, collapsed and then re-expanded.  Currently, the panel does not re-load the content.

 

Is there a way to force the panel to be re-loaded?

Antonio
Top achievements
Rank 1
Iron
 answered on 17 Nov 2023
1 answer
56 views

Hi,

I first tried using a loop creating expansion panels which works fine on the face of it but each expansion panel needs to have a Rich Text Editor inside of it and it was not allowing me to click into the editor so I read it may be better to use a PanelBar to achieve what i need.

Basically what I need it to loop through a collection within the ViewModel and create a Panel Bar Item for each one. Each Panel Bar Item will generate 3 Rich Text Editors with Labels.

The markup shows no errors but when running I get "System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'". This happens with even a single control referencing the index of the for loop e.g.:

An example of the code is:

@(Html.Kendo().PanelBar()
                    .Name("panelbar")
                    .ExpandMode(PanelBarExpandMode.Multiple)
                    .Items(panelbar =>
                    {

                        for (int i = 0; i < Model.SomeCollection.Count; i++)
                        {
                            panelbar.Add().Text(Model.SomeCollection[i].SectionHeading)
                                .Expanded(false)
                                .Selected(false)
                                .Content(@<text>
                                             
                                @Html.HiddenFor(model => model.SomeCollection[i].SectionUid)

                          </text>);
                        }
                    }))

 

If I don't reference the i of the for loop within the content it works fine e.g.:

 

@(Html.Kendo().PanelBar()
                    .Name("panelbar")
                    .ExpandMode(PanelBarExpandMode.Multiple)
                    .Items(panelbar =>
                    {

                        for (int i = 0; i < Model.SomeCollection.Count; i++)
                        {
                            panelbar.Add().Text(Model.SomeCollection[i].SectionHeading)
                                .Expanded(false)
                                .Selected(false)
                                .Content(@<text>
                                
                                             <div>Some Text</div>

 

                          </text>);
                        }
                    }))

 

The reason I am using a 'for i =' loop instead of a foreach loop is because the collection was not being returned to the controller on post when I used a foreach loop but this method worked which could be down to my inexperience with MVC but I went with what worked.

The Expansion Panels worked great other than not being able to click into the Kendo().Editor() controls at all when they were inside the for loop. If I bound them to a control outside of the loop then they worked fine.

Any help would be greatly appreciated.

 

 

Vasko
Telerik team
 answered on 21 Jul 2023
1 answer
50 views

The background color of the Main panel item and the sub panel items.  Can someone help me set the background color of the subitems to something different.

For example, when I click on Q1 Forecast I would like it be Red to give a visual indication that you have selected a sub item.  Sales Forecast should remain Aqua Blue which is set from the Theme.

 

Ivan Danchev
Telerik team
 answered on 06 Feb 2023
0 answers
122 views
1 answer
124 views

Hi,

So basically I'm trying to load the items of my PanelBar at the creation of the PanelBar. My item has a LoadContentFrom itself but it only triggers once I open the panelbar item. It used to work with the LoadOnDemand property set to false but it doesn't anymore. Any idea what is I am doing wrong here?

@(Html.Kendo().PanelBar()
            .Name("panelbar")
            .ExpandMode(PanelBarExpandMode.Multiple)
            .HtmlAttributes(new { @class = "k-primary", type = "submit", style = "width:100%" })
            .LoadOnDemand(false)
            .Items(panelbar =>
            {
                panelbar.Add().Text("Item Title").LoadContentFrom(Url.Action("Function", "Controller", Model));
            }))

 

Thanks again!

Yanislav
Telerik team
 answered on 29 Apr 2022
1 answer
148 views

Hi,

I would like to know how to setup a generic MVC layout(page) with a (panelbar) menu on the left (collapsable when mobile) 
together with a Breadcrumb. Should be responsive / mobile first.
Actually something like your demos page navigation, but then the menu should be collapsable. Like the panelbar.

Is there a complete example for this ? Or do I have to fuzzle manually to achieve this ?

(At first I was thinking about using the menu control, but to my surprise I saw that control is not responsive.)

Martin

Ivan Danchev
Telerik team
 answered on 15 Jun 2021
24 answers
487 views

Hi

 

I saw a thread about not getting to the ID of a panelbar item in the OnSelect handler from 2012. I almost can't believe that Telerik did not yet fix this issue. But i can't find anything so i'm afraid they didn't. 

It should be that easy to add to the component.

 

Eric

 

Ivan Danchev
Telerik team
 answered on 30 Aug 2019
3 answers
447 views

Is there a way to set a panelbar individual panel title text with a ViewBag value instead of a literal string?  In my code on line 7, the text is set as "Not Submitted". But I would like to populate it with a string value I build and place in Viewbag that shows a count of records for the type of "Not Submitted". It would read like this - "Not Submitted - (20)".  If it's possible, what would be the syntax to use a variable/constant instead of literal string?

                                     

01.@(Html.Kendo().PanelBar()
02..Name("panelbar")
03..ExpandMode(PanelBarExpandMode.Single)
04..HtmlAttributes(new { style = "width:100%" })
05..Items(panelbar =>
06.{
07.      panelbar.Add().Text("Not Submitted")
08.        .Expanded(false)
09.}
Marin Bratanov
Telerik team
 answered on 10 Jan 2019
3 answers
452 views

Hi there,

I'm using kendo PanelBar with foreach for the nested contents, here is the code:

<div class="col-lg-12">
                @(Html.Kendo().PanelBar()
                .Name("OrganizerTour")
                .ExpandMode(PanelBarExpandMode.Multiple)
                .HtmlAttributes(new { style = "" })
                .Items(panelbar =>
                {
                    foreach (var result in Model)
                    {
                        panelbar.Add().Text("Organizer: " + @result.organizerName).Expanded(true)
                            .Items(tour =>
                            {
                                tour.Add().Expanded(true).Content(@<div class="panel-content">
                                    <div class="row dashboard-grid">
                                        @RenderGrid(result.Result)
                                    </div>
                                </div>);
                            });
                    }
                })
                )
            </div>

When each PanelBar is expanded, there are two arrows showing (see attached) - it's fine when collapsed.

How can I remove the bottom arrow? Or is it something wrong with the codes above?

Ivan Danchev
Telerik team
 answered on 22 Aug 2018
3 answers
81 views
Hello, 

Is there any way to show a busy indicator on PaneBar (like Kendo Grid), when loading data or doing a long operation? 

Thanks for your help. 
Regards
Ivan Danchev
Telerik team
 answered on 13 Jul 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?