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

Gridview in UserControl and Scroll Bars

3 Answers 161 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David Cecil
Top achievements
Rank 1
David Cecil asked on 06 Apr 2010, 01:53 AM
Hello,

We have a gridview in a usercontrol that we would like to exand to the size of the window.  However, unless you specifiy the size of the Gridview or the Size of the usercontrol the scroll bars will not appear.  Is there a way around this?  Please note we're using a gridview inside of grid where the grid row definition Height definition is set to "*".  Below is the xaml code along with a screenshot.

<UserControl  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:Controls="clr-namespace:Dad.Common.UI.Controls;assembly=Dad.Common" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="Dad.Modules.Security.Presentation.Views.OrganizationalUnits" 
    Margin="1" HorizontalAlignment="Left" VerticalAlignment="Top"   
    mc:Ignorable="d" d:DesignWidth="680" d:DesignHeight="600" 
    >   
      
<!--    <Grid Margin="1,1,1,1"> --> 
          
 
<Grid> 
 
        <Grid.RowDefinitions> 
            <RowDefinition Height="80"/>  
            <RowDefinition Height="40"/>  
            <RowDefinition Height="*"/>  
        </Grid.RowDefinitions> 
          
        <Border Grid.Row="0" Margin="0,0,0,0" VerticalAlignment="Top" Height="80" Width="Auto">  
            <Border.Background> 
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">  
                    <GradientStop Color="#FF175D12"/>  
                    <GradientStop Color="#FF93D48E" Offset="1"/>  
                </LinearGradientBrush> 
            </Border.Background> 
            <Image HorizontalAlignment="Left" Margin="0,0,0,2" Width="371" Source="/Dad.Modules.Security;Component/Images/OULabel.png"/>  
        </Border> 
          
        <Border Grid.Row="1" Margin="0,0,0,0" VerticalAlignment="Top" Height="40" Width="Auto">  
            <StackPanel Orientation="Horizontal">  
 
                <telerik:RadButton Content="Refresh" Height="30" Width="80" Margin="15,5,0,5"/>  
                <Controls:RadGridViewExporter Height="30" RadGridView="{Binding ElementName=OUGridView}" /> 
                  
            </StackPanel> 
        </Border> 
          
            <telerik:RadGridView x:Name="OUGridView" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                ItemsSource="{Binding OrganizationalUnits}"/>  
 
</Grid>   
</UserControl> 


3 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 06 Apr 2010, 10:02 AM
Hi David Cecil,

This indeed is an interesting case. Much to my regret however I was unable to reproduce the error. Could you please send me a sample so I can investigate this further?

All the best,
Kalin Milanov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Cecil
Top achievements
Rank 1
answered on 06 Apr 2010, 04:48 PM
Hello, thanks for your quick response, but I found the problem.

We're using a "shell" for the application.  The region where the above usercontrol lived was defined as an ItemsControl.  I changed this to a ContentControl and the scroll bars showed up.
0
Dave
Top achievements
Rank 2
answered on 13 May 2011, 06:41 PM
Thanks a lot for posting your solution! Was running into the same problem and you had the answer. Was driving me nuts!

-dave
Tags
GridView
Asked by
David Cecil
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
David Cecil
Top achievements
Rank 1
Dave
Top achievements
Rank 2
Share this question
or