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

Vertical Scrollbar problem with one group

3 Answers 555 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Apar
Top achievements
Rank 1
Apar asked on 06 Jul 2015, 01:44 PM

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

3 Answers, 1 is accepted

Sort by
0
Geri
Telerik team
answered on 09 Jul 2015, 07:59 AM
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
0
Apar
Top achievements
Rank 1
answered on 09 Jul 2015, 09:26 AM

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

0
Geri
Telerik team
answered on 10 Jul 2015, 01:52 PM
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
Tags
ListBox
Asked by
Apar
Top achievements
Rank 1
Answers by
Geri
Telerik team
Apar
Top achievements
Rank 1
Share this question
or