I have a ContentPane containing a simple Grid which I add rows to programmatically at run-time.
When I reduce the size of the ContentPane so that not all the rows are visible, no vertical scrollbar appears. How do I cause it so that a scrollbar does appear?
I have a attached a simple example of the problem I am having.
Many thanks,
Jason
Hello Jason,
I believe the Grid will measure its children elements infinite height if you do not set their height property explicitly and this is why it is happening. One thing that you can do is create a scrollviewer around the grid which will give you the Scrollbars.
<ScrollViewer>
<Grid Name="grid">
<Grid.ColumnDefinitions>
<ColumnDefinition />
</Grid.ColumnDefinitions>
</Grid>
</ScrollViewer>
</igDock:ContentPane>
Below is the sample code, which I tried to implement, but no scrollBar is appearing whenever text is out of viewable area. Kindly tell me where I'm wrong.
<igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedLeft">
<igDock:ContentPane Header="Left" IsPinned="True" Background="Transparent">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
< Grid.Row="0" Margin="0 10" Width="250">
<RowDefinition Height="35" />
<RowDefinition Height="Auto" />
<Button Style="{StaticResource Button_Theme}" Grid.Row="0"/>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<DockPanel Grid.Row="0" Margin="1">
</DockPanel>
</igDock:SplitPane>
Thanks,
VJ
Excellent, that worked! Thank you! Simples!