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

Horizantal Scrollbar for GridView not visible

5 Answers 369 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ejaz
Top achievements
Rank 1
Ejaz asked on 18 Sep 2014, 06:10 AM
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.

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Sep 2014, 03:09 PM
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.
 
0
Ejaz
Top achievements
Rank 1
answered on 22 Sep 2014, 06:40 AM
Not a stackpanel, I've placed it in a wrap panel with horizontal orientation.
0
Dimitrina
Telerik team
answered on 22 Sep 2014, 08:34 AM
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.
 
0
Ejaz
Top achievements
Rank 1
answered on 22 Sep 2014, 09:12 AM
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.
0
Dimitrina
Telerik team
answered on 23 Sep 2014, 11:14 AM
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.
 
Tags
GridView
Asked by
Ejaz
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Ejaz
Top achievements
Rank 1
Share this question
or