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

radexpender in scrollview does not fill the entire area

3 Answers 85 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Hila
Top achievements
Rank 1
Hila asked on 26 Jun 2016, 07:51 AM

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

 

3 Answers, 1 is accepted

Sort by
0
Hila
Top achievements
Rank 1
answered on 28 Jun 2016, 12:06 PM
anyone???
0
Hila
Top achievements
Rank 1
answered on 28 Jun 2016, 12:24 PM
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)
0
Kiril Vandov
Telerik team
answered on 29 Jun 2016, 09:04 AM
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.
Tags
Expander
Asked by
Hila
Top achievements
Rank 1
Answers by
Hila
Top achievements
Rank 1
Kiril Vandov
Telerik team
Share this question
or