Scroll Bars

2 posts, 0 answers
  1. Simon Allport
    Simon Allport avatar
    32 posts
    Member since:
    Aug 2009

    Posted 19 Jan 2011 Link to this post

    Hi,
    I have a RadWindow and I always want the rad window to have a horizontal scroll bar but, it is never displayed and I don't know why. Any Help would be great?


    Thanks

    Simon
    <my1:RadWindow Name="PatientAlertWindow" BorderThickness="1" Background="#FF388CE3" BorderBackground="White" Foreground="Black" WindowStartupLocation="CenterOwner"  Width="570" Height="450" Closed="PatientAlertWindow_Closed" HorizontalAlignment="Left" Margin="0,0,0,227" VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" Header="Patient Alert" GotFocus="PatientAlertWindow_GotFocus">
                    <Grid Background="#FF388CE3" SelectiveScrollingGrid.SelectiveScrollingOrientation="Both" ScrollViewer.HorizontalScrollBarVisibility="Visible" MinWidth="500">
                        <Grid.ColumnDefinitions>
      
                            <ColumnDefinition />
                            <ColumnDefinition />
      
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                       <DataGrid AutoGenerateColumns="True" Name="PatientGrid" ItemsSource="{Binding}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" MinWidth="500" MinHeight="450" IsReadOnly="True" ScrollViewer.HorizontalScrollBarVisibility="Auto"/>
                    </Grid>
                </my1:RadWindow>
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 19 Jan 2011 Link to this post

    Hello Simon Allport,

    RadWindow template does not include ScrollViewer. So if you want to show ScrollViewer in RadWindow you should add it as a first element of RadWindow, e.g.

    my1:RadWindow Name="PatientAlertWindow" 
    ...>  
       <ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible"
          <Grid Background="#FF388CE3" MinWidth="500">  
      ...
        <DataGrid AutoGenerateColumns="True" Name="PatientGrid" ItemsSource="{Binding}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" MinWidth="500" MinHeight="450" IsReadOnly="True" ScrollViewer.HorizontalScrollBarVisibility="Auto"/>  
       </Grid>  
    </my1:RadWindow>

    But this will break DataGrid virtualization. So I would recommend to change only the ScrollViewer.HorizontalScrollBarVisibility="Always" on DataGrid control:

    ...
    <DataGrid ScrollViewer.HorizontalScrollBarVisibility="Always" /> 
    ...

    Let us know if you need more information.

    Regards,
    Hristo
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top