Vertical Scrollbar problem with one group

4 posts, 0 answers
  1. Apar
    Apar avatar
    4 posts
    Member since:
    Jul 2015

    Posted 06 Jul 2015 Link to this post

    Hi,

    We have customised the RadListBox control for our use and are also using CollectionViewSource for grouping. The problem is that the vertical scroll is not showing when there is only a single group.

    If there are more than one groups the vertical scroll appears as usual when needed.

    We are using a WrapPanel for the ItemsPanelTemplate and have disabled the Horizontal Scrollbar so the items are only stacked vertically when the control is resized.

    Please suggest what can be wrong.

     

    Regards

    Apar

  2. Geri
    Admin
    Geri avatar
    60 posts

    Posted 09 Jul 2015 Link to this post

    Hi Apar,

    We've reproduced the scenario. The described behavior is caused by a peculiarity of ScrollViewer - it perceives each group as a separate item that takes part in scrolling and if there's only one group, it wouldn't scroll, disregarding the number of items in the group. Whether an element is allowed to scroll or not, is controlled by the value of CanContentScroll property - if it's "True", the ScrollViewer scrolls in terms of logical units (item-by-item); if it's "False", the scrolling is in terms of physical units (pixel-by-pixel). The default value for CanContentScroll in RadListBox is "True", so if there's only one group, scrolling would not be available. Setting the value of this property to "False" would do the trick:

    <telerik:RadListBox ScrollViewer.CanContentScroll="False" />

    Doing this, we break visrtualization, but in cases where a container that doesn't support virtualization is used (like WrapPanel) it doesn't cause any harm.

    Hope this helps.

    Regards,
    Geri
    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 WPF is Visual Studio 2017 Ready
  4. Apar
    Apar avatar
    4 posts
    Member since:
    Jul 2015

    Posted 09 Jul 2015 in reply to Geri Link to this post

    Hi Geri,

    Thanks for the prompt reply! I too was able to find and understand this problem. Now I have set the CanContentScroll property to False and the vertical scrollbar appears when needed even with one group.

    But now I see another wierd behavior in the RadListBox Control.

    I have a RadListBox with more than one group and enough items in one group that few  of the items are always out of view.

    Now, when I select the first or any visible item, the scrollbar scrolls to bring the last item in the same group into the view. And again if I select the last item the scrollbar scrolls in opposite to bring the first item into the view. Whichever item you select the scrollbar scrolls in the opposite direction.

    If the you resize the control to a very small height the selected item is moved out of the view and even double click is not possible.

    Is this behavior related to the issue mentioned in these posts?

    http://www.telerik.com/forums/scrollviewer-bug-when-grouping

    http://feedback.telerik.com/Project/143/Feedback/Details/156570-radlistbox-is-not-able-to-scroll-to-item-when-the-items-are-grouped

     If not, please suggest how can I fix this problem.

    Regards,

    Apar

  5. Geri
    Admin
    Geri avatar
    60 posts

    Posted 10 Jul 2015 Link to this post

    Hello Apar,

    We were able to observe the described behavior. The second part of the issue you tell us about is a known one and is logged in our feedback portal - you can track its progress here:

    http://feedback.telerik.com/Project/143/Feedback/Details/156692-the-scroll-moves-when-it-is-not-needed-only-if-scrollviewer-cancontentscroll-fa

    As for the scrolling to the last item - we've logged it in our internal backlog, but unfortunately there is no workaround that we can suggest at this point.

    What we can suggest you is to try to use another Telerik control instead of RadListBox. 

    For example, if you want to display hierarchical navigation systems by creating parent-child relations between the nodes, RadTreeView might be suitable.

    We're sorry for the inconvenience this may be causing. We've updated your Telerik points for your involvement.

    If you have any further queries, please don't hesitate to contact us.

    Regards,
    Geri
    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