Docking and GridView Resizing

2 posts, 0 answers
  1. James
    James avatar
    136 posts
    Member since:
    Nov 2008

    Posted 16 Sep 2009 Link to this post


    I have noticed a strange display issue with Horizontal Scroll bars when resizing a RadDocumentPane that contains a RadGridView control.

    When a GridViewColumn is set to star width sizing, and the width of the RadDocumentPane is reduced by dragging the splitter across, a Horizontal Scrollbar appears temporarily as the splitter handle is released by the mouse, then disappears again, even though there is plenty of horizontal space and no need for it to show.

    If the width is set to Auto then the problem goes away.

    Here's the xaml (nothing fancy in CS so don't bother posting):

                            <telerikDocking:RadDocumentPane Header="Document 1" Title="Document 1">  
                                    <Controls:RadGridView x:Name="dgRadGridViewMain" AutoGenerateColumns="False" ScrollViewer.HorizontalScrollBarVisibility="Auto">  
                                            <Controls:GridViewColumn Width="Auto" HeaderText="First Name">  
                                                        <TextBlock Text="{Binding FirstName}" /> 
                                            </Controls:GridViewColumn > 
                                            <Controls:GridViewColumn Width="*" HeaderText="Last Name">  
                                                        <TextBlock Text="{Binding LastName}" /> 
                <telerikDocking:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft">  
                        <telerikDocking:RadPane Header="Pane Left 1">  

    Are you able to replicate this?



  2. Hristo
    Hristo avatar
    832 posts

    Posted 17 Sep 2009 Link to this post

    Hello James,

    This is the default behavior when you have Fill mode. It happens because the size of the RadGridView is changed (get smaller) and the columns width is not updated immediately. We need one layout pass in order to calculate the new size for the columns - they may be proportional and you can have columns with fixed or auto width so we have to calculate it on the second layout pass. But this makes the scrollViewer to update its scrollbars because the previous measure returned X width and now it has Y (where Y < X) width. Then on the second layout pass we redistribute the remaining space for the star columns and update them. This fires third layout pass where scrollviewer updates its horizontal scroll bar and hide it.

    Let us know if you need more information.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top