Scrolling behavior GridView in Docking inside Scrollviewer

5 posts, 1 answers
  1. Li
    Li avatar
    46 posts
    Member since:
    Feb 2011

    Posted 08 Mar 2012 Link to this post

    Hi,
    we are implementing a portal applcation and we laod Pages inside a Frame using Navigation Frawork. The xaml code in which the Frame is cotained uses a Scrollviewer. But when we are loading Pages wich contain Dockings, there are problems wiht the displaying of Colums of GridView. The problem also exist when I do not use a Frame, so I isolated some sample code, where you can see the problem. I attached two screenshots and here is the code:
    <UserControl x:Class="ScrollBarTest.MainPage"
            mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
            xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" >
     
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <telerik:RadDocking AllowUnsafeMode="True" x:Name="MainDocking" >
                <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedTop">
                    <telerik:RadPaneGroup>
                        <telerik:RadPane CanUserClose="False" CanUserPin="False" ContextMenuTemplate="{x:Null}">
                            <Grid>
                                <telerik:RadGridView >
                                    <telerik:RadGridView.Columns>
                                        <telerik:GridViewDataColumn Header="Header1" />
                                        <telerik:GridViewDataColumn Header="Header2" />
                                        <telerik:GridViewDataColumn Header="Header3" />
                                        <telerik:GridViewDataColumn Header="Header4" />
                                        <telerik:GridViewDataColumn Header="Header5" />
                                    </telerik:RadGridView.Columns>
                                </telerik:RadGridView >
                            </Grid>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking>
        </ScrollViewer>
    </UserControl>


    If I let this example run, only two columns of the RadGridView are visible (image 1), the other appear when I use the horizontal scrollbar of the GridView (image 2). I tried setting width of columns, but it does not work.
    It seems, as if hte with of the colums cannot be calculated correctly. Is there a way to get such a scenario work?
    I am using version in our project 2011.3.1116.1040. I also tried this code with versin Q1 2012 but it did not work anyway.

    Thanks for help,

    Li
  2. Vera
    Admin
    Vera avatar
    268 posts

    Posted 08 Mar 2012 Link to this post

    Hello Li,

     
    This unexpected behavior is caused by the ScrollViewer. May I ask you to share some more details about the result you are trying to achieve by using it? When there are more columns than the viewport can show a scrollbar appears. So if you are using it because of RadGridView, I would suggest you to remove it and you will not get the described behavior.


    I hope this helps. Looking forward to hearing from you.

    Regards,
    Vera
    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. Li
    Li avatar
    46 posts
    Member since:
    Feb 2011

    Posted 09 Mar 2012 Link to this post

    Hello Vera,

    thanks for your reply.
    We are implementing an application which is used like a portal. Different silverlight applications wil be loaded into the portal.
    The customer has the requirements, that the region, where the application screens are shown should be scrollable. I adapted a scheme from our application to try to make it clearer.
    That the reason why I use a Scrollviewer, not because of the Gridview. I know that removing the Scrollviewer would solve the issue, but that does not meet the requirements and is not a solution for me. I tried different scenarios and the problem is caused by the combination of Dockings and Scrolvier. Without a docking, ad Radgridview inside a Scrollviewer is displayed correctly. During the development I saw other controls which were also not correctly displayed inside the Docking inside a Scrollviewer, so the tabs have not the correct width or Buttons are not displayed correctly. I attached a screenshot of such a case.
    So my question is, whether there is any solution to get such a scenario work with Docking and the Scrollviewer.

    Kind regards,
    Li
  4. Answer
    Georgi
    Admin
    Georgi avatar
    364 posts

    Posted 09 Mar 2012 Link to this post

    Hello Li,

    As you might have seen placing Docking control in a panel or control that measures it with infinite width or height is not supported. Maybe that is why you use AllowUnsafeMode="True". So the problem is a side effect of using UnsafeMode.
    What you can do is set a specific width to the RadGridView. This way the columns should appear properly.
    If does not fit your scenario an alternative is to put the ScrollViewer in the RadPane.

    Hope this will help.

    All the best,
    Georgi
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Li
    Li avatar
    46 posts
    Member since:
    Feb 2011

    Posted 12 Mar 2012 Link to this post

    Hi Georgi,

    thank for your reply. Now I know, that the scenario as we would like to ahave does not work and we have to set a fix width to the GirdView or the Docking. Putting the Scrollviewer into RadPane does not meet the requirements.

    Kind regards, Li
Back to Top