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

RadPanelBar too slow to load, with many items??

3 Answers 149 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aniket
Top achievements
Rank 1
Aniket asked on 01 Mar 2011, 02:07 PM
We are trying to show around 300 items in a radpanelbaritem, with around 5 such baritems in the panel, these baritems need to be expanded by default. We used one of the solutions provided on the forum for scrollbar related issue ( http://www.telerik.com/community/forums/silverlight/panelbar/scroller-for-hierarchical-items.aspx ).
The issue we are facing is that the UI takes simply too much time to load at first.


Modifications to solution provided on the above thread:
Changed item count to (for loop)300 and, panelbaritems expanded by default, and some text box in header as checkbox and title also as checkbox. Please get back to us soon, so as to improvise the startup time for the UI.

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 03 Mar 2011, 05:32 PM
Hi Aniket,

Currently, the UI Virtualization feature is not supported in RadPanelBar, although it inherits from RadTreeView which supports it. If the RadTreeView fits in your scenario, your application will load much faster, cause only the items that are initially in the visual area will be generated, not all the items that are children of an expanded item.
On the other hand, usually when you want to use the BringIntoView method you have to specify the search property like so:

<telerik:RadPanelBar x:Name="radPanelBar"

                                BringIntoViewMode="HeaderAndItems"

                                telerik:TextSearch.TextPath="Title"

And then use GetItemByPath and BringIntoView in conjunction like so:

privatevoidTextBoxTextChanged(objectsender, TextChangedEventArgs e)

        {

            RadPanelBar parentBar = (((sender asTextBox).Parent asGrid) asUIElement).ParentOfType<RadPanelBar>();

            RadPanelBarItem barContainer = parentBar.GetItemByPath("Item 1|"+ (sender asTextBox).Text, "|") asRadPanelBarItem;

            if(barContainer != null)

            {

                barContainer.IsSelected = true;

                barContainer.BringIntoView();

            }

            return;

        }

Unfortunately, this won't work in your scenario, since the default PanelBar structure is changed (at least with the TextBox included).
As a workaround you can get the text typed in the textbox, parse it ( or parse a substring of it) and use it as a factor in the ScrollToVerticalOffset method of the ScrollViewer like so:

privatevoidTextBoxTextChanged(objectsender, TextChangedEventArgs e)

        {

            stringinput = (sender asTextBox).Text;

            intresult;

            var successfullParse = int.TryParse(input, outresult);

            if(successfullParse)

            {

                (((sender asTextBox).Parent asGrid).Children[1] asScrollViewer).ScrollToVerticalOffset(result * 50);

            }

            return;

        }

(Supposing the height of the PanelBaItem is 50). You can even use a mixture of the above two approaches ( first GetItemByPath to get the container and to make the selection and then scroll.

Greetings,
Petar Mladenov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Rory
Top achievements
Rank 1
answered on 19 Jan 2012, 11:45 PM
We need some form of paging or a "SHOW MORE" at the bottom of the Scroll Area because our PanelBar has poor performance when more than 50 panelbaritems are loaded.

For a workaround I am applying search filters that limit the number of panelbar items but this isn't ideal.
0
Petar Mladenov
Telerik team
answered on 24 Jan 2012, 09:15 AM
Hi Rory ,

You can use data binding to ViewModels, add "Show next 10 items", "Show previous 10 items" buttons below the PanleBar and when clicked , you can re-bind the ItemsSource of the RadPanelBar accordingly in order to show the next / previous ten items from the model. 

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
PanelBar
Asked by
Aniket
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Rory
Top achievements
Rank 1
Share this question
or