RadPanelBar too slow to load, with many items??

4 posts, 0 answers
  1. Aniket
    Aniket avatar
    1 posts
    Member since:
    Sep 2010

    Posted 01 Mar 2011 Link to this post

    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.
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 Mar 2011 Link to this post

    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!
  3. DevCraft banner
  4. Rory
    Rory avatar
    159 posts
    Member since:
    Jul 2007

    Posted 19 Jan 2012 Link to this post

    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.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 Jan 2012 Link to this post

    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 >>

Back to Top