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

Prevent Scrolling in DataBoundListBox

5 Answers 112 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin
Top achievements
Rank 1
Justin asked on 01 Mar 2012, 10:42 AM
I've created a screen that displays two DataboundListBoxes like so:
<telerikPrimitives:RadDataBoundListBox x:Name="scenariosList"
                                       telerikCore:InteractionEffectManager.IsInteractionEnabled="True"
                                       CheckBoxStyle="{StaticResource ItemCheckBoxStyle}"
                                       IsCheckModeEnabled="True"
                                       IsCheckModeActive="True"
                                       ItemCheckedStateChanged="scenariosList_ItemCheckedStateChanged"
                                       ItemsSource="{Binding Categories}"
                                       ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                       ItemTemplate="{StaticResource MiniTileTemplate}" />
<TextBlock Text="products" Style="{StaticResource PhoneTextExtraLargeStyle}" Margin="0 10 0 10"/>
<telerikPrimitives:RadDataBoundListBox x:Name="productsList"
                                       telerikCore:InteractionEffectManager.IsInteractionEnabled="True"
                                       CheckBoxStyle="{StaticResource ItemCheckBoxStyle}"
                                       IsCheckModeEnabled="True"
                                       IsCheckModeActive="True"
                                       ItemCheckedStateChanged="productsList_ItemCheckedStateChanged"
                                       ItemsSource="{Binding Components}"
                                       ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                       ItemTemplate="{StaticResource MiniTileTemplate}">
</telerikPrimitives:RadDataBoundListBox>

I then placed that in a stack panel inside of a scrollviewer. The problem is that since the lists scroll themselves, even though they are big enough not to, it won't scroll the scrollviewer. I tried using what was recommended to prevent scrolling on Listboxes, but it doesn't seem to be working here.
ScrollViewer.VerticalScrollBarVisibility="Disabled"

Is there anyway to disable the elastic scrolling?

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 02 Mar 2012, 04:29 PM
Hi Justin,

The attached ScrollViewer.VerticalScrollBarVisibility and ScrollViewer.HorizontalScrollBarVisibility properties are not relevant for RadDataBoundListBox because of its internal scrolling implementation. We have received a couple of requests to support similar behavior, however, and therefore we are going to implement it for the next official release of RadControls for Windows Phone.

In the mean time here's what you can do to prevent RadDataBoundListBox from scrolling:

ScrollViewer sv = ElementTreeHelper.FindVisualDescendant<ScrollViewer>(this.listBox);
sv.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;

Please note that the this.listBox reference is to a RadDataBoundListBox instance.

Let me know if you have further questions or need assistance.

Kind regards,
Deyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Justin
Top achievements
Rank 1
answered on 02 Mar 2012, 07:43 PM
Worked perfectly! It would be nice to see this as a property. Glad to see you already have it in the works. Thank you!
0
Matti
Top achievements
Rank 1
answered on 31 Oct 2013, 02:03 PM
This seems to work ok. It brings up another problem for reordering items. The reorder buttons are located in the bottom of the list. When using external scrollviewer, the bottom of the list might be out of the visible area. User cannot reorder the list then. Is there a solution/workaround for this kind of problem?
0
Matti
Top achievements
Rank 1
answered on 01 Nov 2013, 08:08 AM

I can see two ways using external scrollviewer that could work with reordering items in the list. One would be implementing drag-and-drop for the selected item. Another would be having distinct reorder buttons like now, but placing them on top of the item that is being moved. Currently they lay on top of the last item, which may be out of the visible area.


Without using external scrollviewer it is difficult to implement pages that extend vertically beyond the device screen size.







0
Deyan
Telerik team
answered on 01 Nov 2013, 03:18 PM
Hello Matti,

Thanks for writing back.

We will consider your scenario. For the time being the possible solution is to use the DataBoundListBox' scrolling mechanism instead of placing it into an external scrollviewer.

Let us know should you have additional questions.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
DataBoundListBox
Asked by
Justin
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Justin
Top achievements
Rank 1
Matti
Top achievements
Rank 1
Share this question
or