Horizantal Scrollbar for GridView not visible

6 posts, 0 answers
  1. Ejaz
    Ejaz avatar
    9 posts
    Member since:
    May 2014

    Posted 18 Sep 2014 Link to this post

    I have a simple GridView placed inside a Grid. I'm setting the ItemsSource from C# with auto-generating columns. The vertical scrollbar works fine but the horizontal scrollbar just refuses to show up. This is the code I'm using

    WPF
    <Grid
            <telerik:RadGridView Name="telerikGrid" AutoGenerateColumns="True" ></telerik:RadGridView>          
    </Grid>


    telerikGrid.ItemsSource = TableSource;

    TableSource is an ObservableCollection of dynamic ExpandoObject. This UserControl is placed in a RadTabItem of another UserControl which in turn appears in a RadPane in the MainWindow.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Sep 2014 Link to this post

    Hello,

    Have you eventually placed RadGridView in a StackPanel with Orientation="Horizontal"?

    Regards,
    Dimitrina
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. Ejaz
    Ejaz avatar
    9 posts
    Member since:
    May 2014

    Posted 22 Sep 2014 in reply to Dimitrina Link to this post

    Not a stackpanel, I've placed it in a wrap panel with horizontal orientation.
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 22 Sep 2014 Link to this post

    Hello,

    Then, this should be the reason for the missing scroll bar. I would not recommend you defining RadGridView (or any virtualized control) in such a container as it measures its content with infinity and the virtualization of the grid will be broken. Please take a look at our online documentation for an additional information.

    You could place it under a Grid.Row with Height different than Auto instead.

    Let me know how this works for you.

    Regards, 
    Dimitrina
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. Ejaz
    Ejaz avatar
    9 posts
    Member since:
    May 2014

    Posted 22 Sep 2014 in reply to Dimitrina Link to this post

    I know this is a problem with the container, what I'm unable to figure out is, which container. I have another radgridview in a usercontrol, which is also placed in the same WrapPanel but the horizontal scroll works pretty well for this.  I'll try to explain the scenario a little better .

    This is my usercontrol which contains my RadGridView.
    <UserControl x:Class="UC">
    <
    Grid>
    <telerik:RadGridView Name="telerikGrid" AutoGenerateColumns="True"></telerik:RadGridView>
    </Grid>
    </UserControl>
    <UserControl x:Class="UCMain">
           <Grid>
                <telerik:RadDocking>
                    <telerik:RadDocking.DocumentHost>
                       <telerik:RadSplitContainer>
                          <telerik:RadPaneGroup>
                             <telerik:RadPane Header="Newpane">
                                <telerik:RadPane.Content>
                                    <controls:UC />
                                 </telerik:RadPane.Content>
                               </telerik:RadPaneGroup>
                             </telerik:RadSplitContainer>
                           </telerik:RadDocking.DocumentHost>
                        </telerik:RadDocking>
                 </Grid>
    </UserControl>
    And finally the MainWindow

    <Window x:Class="MainWindow">
    <Grid>
            <Grid.RowDefinitions>      
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid grid.Row="0">
                    <WrapPanel Name="wrapPanel" />
            </Grid>
    </Grid>
    </Window>

    The usercontrol 'UCMain' is added to the wrapPanel in C#. Hope this gives you a better picture.
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Sep 2014 Link to this post

    Hi,

    I tested placing RadGridView under WrapPanel and as a result the horizontal scroll bar displayed fine. I also tested placing RadGridView under RadPane, similar to the code snippet you shared. It also worked good.

    I attached my test project. Would you please try modifying it so that the issue is reproduced?

    Regards,
    Dimitrina
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top