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

Docking and GridView Resizing

1 Answer 78 Views
Docking
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 16 Sep 2009, 11:20 AM

Hello,

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):

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

Are you able to replicate this?

Cheers,

James.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 17 Sep 2009, 12:43 PM
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,
Hristo
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.
Tags
Docking
Asked by
James
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or