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
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.
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
0
Hello,
Have you eventually placed RadGridView in a StackPanel with Orientation="Horizontal"?
Regards,
Dimitrina
Telerik
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
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
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.
The usercontrol 'UCMain' is added to the wrapPanel in C#. Hope this gives you a better picture.
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
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
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.