radexpender in scrollview does not fill the entire area

4 posts, 0 answers
  1. Stav
    Stav avatar
    9 posts
    Member since:
    Dec 2013

    Posted 26 Jun Link to this post

    hello,

    I'm having a problem with my code

    I wrote this code  in a userControl tag:

    <UserControl

    .

    .

    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">

    <Grid>

         <GridDefinitions>

             <RowDefinition Height="25" />

              <RowDefinition Height='*' />

           </GridDefinitions>

     

          <stackPannel Grid.Row="0">

             <lable/>

             <Button Content="Refresh" Command="{Binding RefreshCommand}"/>

           </StackPannel>

     

           <ScrollViewer Grid.Row="1">

              <StackPannel>

                <telerik:RadExpender IsExpender="True">

                      <telerik:RadGridView SelectionMode="Single" IsSyncrinizeWithCurrentItem="True" AutoGenerateColumns="True"  ItemsSource="{Binding SomeList1}"/>

                </telerik:RadExpender>

     

                <telerik:RadExpender IsExpender="True">
                      <telerik:RadGridView SelectionMode="Single" IsSyncrinizeWithCurrentItem="True" AutoGenerateColumns="True"  ItemsSource="{Binding SomeList2}"/>
                </telerik:RadExpender> 

     

                <telerik:RadExpender IsExpender="True">
                      <telerik:RadGridView SelectionMode="Single" IsSyncrinizeWithCurrentItem="True" AutoGenerateColumns="True"  ItemsSource="{Binding SomeList3}"/>
                </telerik:RadExpender> 

     

           </StackPannel>

          </ScrollViewer>

         </Grid>

      </UserControl>

     

    the result is that my scroll view fill only about half of the screen instead of the whole screen, there is no problem with its width only its height is wrong.

    funny thing that happen: at run time if I click on the first exdpender's button in order to set IsExpended to false

    the scroll view suddenly get the right height and fill the whole area.

    what is wrong with this code?

    I tried change stackPannel to DouckPannel,Grid, set the height... 

    how can I make the scrollview know it's height if I do not know the length of the ItemSource on each radexpender

    thank you

     

  2. Stav
    Stav avatar
    9 posts
    Member since:
    Dec 2013

    Posted 28 Jun Link to this post

    anyone???
  3. UI for WPF is Visual Studio 2017 Ready
  4. Stav
    Stav avatar
    9 posts
    Member since:
    Dec 2013

    Posted 28 Jun Link to this post

    another problem I have is that I get exception (not enough memory) in a very large files.  could it be that controls such as radexpender cannot hold/present a very long list (i'm talking about 15,000 items in list)
  5. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 29 Jun Link to this post

    Hello,

    Let me get straight to your questions:
     - "the result is that my scroll view fill only about half of the screen instead of the whole screen" - I was not able to reproduce such behavior. I guess that the xaml that you are hosting the UserControl is located in grid wich is taking a particular part of the screen on Height and that is why the control is not Stretched. You can easily debug this by setting background to all elements and check out the result.
    - " the scroll view suddenly get the right height and fill the whole area." was not able to reproduce it with the code snippet.
    - "how can I make the scrollview know it's height if I do not know the length of the ItemSource on each radexpender"  - the height of the scrollViewer unless let will be infinity and will always measure its children with Infinity, leading to expanding all the lines of the grid inside a single ScrollViewer which is not a good idea.

    Hosting the RadGridView inside a ScrollViewer is generally not a good idea as it will Measure the GridView with Infinity in Height which will automatically disable its Virtualization function. Based on the Items loaded in the Grid, in your case 15k it is based on the machine and the provided Memory for the application in which moment may crash and throw OOM exception. The RadGridView have its own build in scrollViewer which will be automatically displayed if you host lots of items and the Height of the Grid is smaller.
    As an advice is to remove either remove the ScrollViewer or set Height to each GridView. Based on the application and the Window you could recalculated the Height dynamically when the Window changes its size based on your custom logic.

    I hope this information helps.

    Kind regards,
    Kiril Vandov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top