Horizontal scrollbar can't be hidden

3 posts, 0 answers
  1. B Jones
    B Jones avatar
    6 posts
    Member since:
    Jun 2010

    Posted 27 Oct 2011 Link to this post

    In the latest dev build it is not possible to hide the horizontal scrollbar. This was working in the version I was using previously, 2011.1.411.1040. This seems to be caused by a change to GridViewVirtualizingPanel.MeasureOverride. I have worked around the problem by creating a derived class that saves off the HorizontalScrollBarVisibility, calls the base class MeasureOverride, and restores the original visibility.
    public class MyTreeListViewVirtualizingPanel : TreeListViewVirtualizingPanel
    {
        protected override Size MeasureOverride(Size constraint)
        {
            var visibility = this.ScrollOwner.HorizontalScrollBarVisibility;
            var size = base.MeasureOverride(constraint);
            this.ScrollOwner.HorizontalScrollBarVisibility = visibility;
     
            return size;
        }
    }

    Xaml that demonstrates the problem:
    <telerik:RadTreeListView x:Name="_tree" ItemsSource="{Binding TheData}"
            AutoGenerateColumns="False"
            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
            ScrollViewer.VerticalScrollBarVisibility="Hidden">
     
        <telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
        </telerik:RadTreeListView.ChildTableDefinitions>
     
        <telerik:RadTreeListView.Columns>
            <telerik:GridViewDataColumn Header="Column 1" Width="400" DataMemberBinding="{Binding Col1}" />
            <telerik:GridViewDataColumn Header="Column 2" Width="400" DataMemberBinding="{Binding Col2}" />
        </telerik:RadTreeListView.Columns>
    </telerik:RadTreeListView>


    I've also attached an image that shows the scrollbar is visible in spite of being hidden in the xaml (screenshot taken w/o the workaround).
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 01 Nov 2011 Link to this post

    Hello B Jones,

    Indeed I was able to see that setting the ScrollViewer.HorizontalScrollBarVisibility is not taking any effect with the latest version of the controls. We will investigate what is wrong.

    Until then I may suggest you another workaround as well - you could set the ColumnWidth="*" property
     of the RadGridView. That way there will be not a horizontal ScrollBar shown.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 16 Nov 2011 Link to this post

    Hi B Jones,

     We have resolved the problem with the ScrollViewer.HorizontalScrollBarVisibility. Soon, the Q3 2011 version of the RadControls will be released and the fix will be available within it.

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top