1

I am creating A WPF window. This window contains a user control which in turn contains an item control. This user control can be of any height, hence i wanted to put a scroll bar. I am using the below code, but it doesn't works. Can some one point what change should i make

<ScrollViewer VerticalScrollBarVisibility="Visible">
    <UC:History x:Name="ucHistory"/>
</ScrollViewer>

Update : Thanks J.H. U set the height to the scroll viewer and that worked My ques is , how would i know the height at run time as the alllication can run on any system display size, basicly i want to put scroll over ucPatientHistory control below
Outer User control (this is added to window)

                <!-- right bottom-->
                <UC:PatientDispensationHistory x:Name="ucPatientHistory"/>

            </StackPanel>
        </Grid>

        <!-- Left Side-->
        <UC:NewDispensation x:Name="ucDispenceAgain"/>

    </DockPanel>
</Grid>

UC:PatientDispensationHistory

<ScrollViewer Height="250">
    <GroupBox Header="Visit History" >
    <StackPanel>
        <TextBlock Text="No Visit History"  Visibility="{Binding NoVisitText}" x:Name="txtNoVisit"/>

        <ItemsControl Name="CtrlPatientVisitHistory" Margin="8" ItemsSource="{Binding PatientVisitDetails}">
.....
       </ItemsControl>
    </StackPanel>
    </GroupBox >
</ScrollViewer >

0 Answers0