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

Scroll Bars

1 Answer 148 Views
Window
This is a migrated thread and some comments may be shown as answers.
Simon Allport
Top achievements
Rank 2
Simon Allport asked on 19 Jan 2011, 12:18 PM
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>

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 19 Jan 2011, 01:24 PM
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>>
Tags
Window
Asked by
Simon Allport
Top achievements
Rank 2
Answers by
Hristo
Telerik team
Share this question
or