Prevent Scrolling in DataBoundListBox

6 posts, 0 answers
  1. Justin
    Justin avatar
    2 posts
    Member since:
    Feb 2012

    Posted 01 Mar 2012 Link to this post

    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?
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 02 Mar 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Justin
    Justin avatar
    2 posts
    Member since:
    Feb 2012

    Posted 02 Mar 2012 Link to this post

    Worked perfectly! It would be nice to see this as a property. Glad to see you already have it in the works. Thank you!
  5. Matti
    Matti avatar
    8 posts
    Member since:
    Sep 2013

    Posted 31 Oct 2013 Link to this post

    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?
  6. Matti
    Matti avatar
    8 posts
    Member since:
    Sep 2013

    Posted 01 Nov 2013 Link to this post

    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.







  7. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 01 Nov 2013 Link to this post

    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 >>
Back to Top
DevCraft banner