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

Horizontal scrollbar can't be hidden

2 Answers 75 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
B Jones
Top achievements
Rank 1
B Jones asked on 27 Oct 2011, 05:49 PM
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 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 01 Nov 2011, 01:44 PM
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 >>

0
Dimitrina
Telerik team
answered on 16 Nov 2011, 01:27 PM
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 >>

Tags
TreeListView
Asked by
B Jones
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or