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

Footer and Scrolling Issue

5 Answers 104 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mauro
Top achievements
Rank 1
Mauro asked on 17 Apr 2012, 08:29 PM
Hi,

I'm not sure if I'm doing something wrong. When I have a footer and I change the amount of items in the datasource, I cannot scroll up anymore.

I couldnt attach a sample project (Why is that...it would have made it much easier for you guys?) so I have pasted the code for the xaml and code behind here.


<Grid x:Name="LayoutRoot"
          Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
 
        <!--  TitlePanel contains the name of the application and page title  -->
        <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle"
                       Style="{StaticResource PhoneTextNormalStyle}"
                       Text="MY APPLICATION" />
            <TextBlock x:Name="PageTitle"
                       Margin="9,-7,0,0"
                       Style="{StaticResource PhoneTextTitle1Style}"
                       Text="page name" />
        </StackPanel>
 
        <!--  ContentPanel - place additional content here  -->
        <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0,12,0">
 
            <telerikPrimitives:RadDataBoundListBox x:Name="ListBox"
                                                   Grid.Row="1"
                                                   Margin="{StaticResource PhoneVerticalMargin}"
                                                   EmptyContentDisplayMode="DataSourceEmpty"
                                                   IsAsyncBalanceEnabled="False"
                                                   ItemsSource="{Binding Scores}"
                                                   ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                                                   x:FieldModifier="private">
 
                <!--  Item Added Animation  -->
                <telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
                    <telerikCore:RadFadeAnimation Duration="0:0:0.2"
                                                  EndOpacity="1"
                                                  StartOpacity="0">
                        <telerikCore:RadFadeAnimation.Easing>
                            <CubicEase EasingMode="EaseIn" />
                        </telerikCore:RadFadeAnimation.Easing>
                    </telerikCore:RadFadeAnimation>
                </telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
 
                <!--  Item Removed Animation  -->
                <telerikPrimitives:RadDataBoundListBox.ItemRemovedAnimation>
                    <telerikCore:RadFadeAnimation Duration="0:0:0.1"
                                                  EndOpacity="0"
                                                  StartOpacity="1">
                        <telerikCore:RadFadeAnimation.Easing>
                            <CubicEase EasingMode="EaseIn" />
                        </telerikCore:RadFadeAnimation.Easing>
                    </telerikCore:RadFadeAnimation>
                </telerikPrimitives:RadDataBoundListBox.ItemRemovedAnimation>
 
                <!--  Empty Content Template  -->
                <telerikPrimitives:RadDataBoundListBox.EmptyContentTemplate>
                    <DataTemplate>
                        <Grid HorizontalAlignment="Center"
                              VerticalAlignment="Center">
                            <TextBlock Style="{StaticResource PhoneTextNormalStyle}"
                                       Text="No Info"
                                       TextAlignment="Center"
                                       TextWrapping="Wrap" />
                        </Grid>
                    </DataTemplate>
                </telerikPrimitives:RadDataBoundListBox.EmptyContentTemplate>
 
                <!--  Footer Template  -->
                <telerikPrimitives:RadDataBoundListBox.ListFooterTemplate>
                    <DataTemplate>
 
                        <TextBlock Style="{StaticResource PhoneTextAccentStyle}"
                                   Text="Footer"
                                   TextAlignment="Center"
                                   TextWrapping="Wrap" />
 
                    </DataTemplate>
                </telerikPrimitives:RadDataBoundListBox.ListFooterTemplate>
 
            </telerikPrimitives:RadDataBoundListBox>
        </Grid>
    </Grid>
 
    <!--  Sample code showing usage of ApplicationBar  -->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsMenuEnabled="True"
                              IsVisible="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png"
                                            Text="Load 100" Click="Load100" />
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png"
                                            Text="Load 10"  Click="Load10"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png"
                                            Text="Load 0"
                                            Click="Load0" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

and the code behind

public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }
 
        private void Load10 (object sender, EventArgs e)
        {
            IList<int>  aa = new List<int>();
            for (int i = 0; i < 10; i++)
            {
                aa.Add(i);
            }
 
            ListBox.ItemsSource = aa;
        }
 
        private void Load100 (object sender, EventArgs e)
        {
            IList<int> aa = new List<int>();
            for (int i = 0; i < 100; i++)
            {
                aa.Add(i);
            }
 
            ListBox.ItemsSource = aa;
        }
 
        private void Load0 (object sender, EventArgs e)
        {
            ListBox.ItemsSource = new List<int>(); ;
        }
    }

In order to replicate it, click the first bottom button, called "load 100", then click the next one "load 10" and then finally the "load 0" button. Then reverse the clicks (IE. Click from  "load 0" to "load 100") and once you have clicked the "load 100", you cannot scroll to the top anymore.

Is there some setting that I'm maybe missing that is causing the issue?

Thanks very much

Regards,
Mauro

Update : I also see that sometimes while changing, the items are all of a sudden vertically aligned in the middle or the bottom of the page?

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 18 Apr 2012, 09:13 AM
Hello Mauro,

 Thanks for contacting us and for reporting this issue.

I would like to inform you that we have been able to reproduce it on our side using the code snippets that you have provided. We will investigate the case and provide a fix for it in an upcoming Internal Build that you will be able to download from our website.

I have added 1000 Telerik points for bringing our attention to this issue.

As for not being able to upload your project: files can be uploaded only in Support Tickets for security reasons. In our forums uploads of projects are not allowed due to the concerns that might arise regarding publishing proprietary source code, etc.

Let me know in case you have further questions or need assistance.

Regards,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mauro
Top achievements
Rank 1
answered on 18 Apr 2012, 09:58 AM
Hi Deyan,

Cool...thank you very much :)

Just out of interest were you also able to replicate the update that I posted, regarding the alignment sometimes being in the middle, sometimes at the bottom when changing the sources? From what I have seen it happens very randomly.

Thanks again

Regards,
Mauro

0
Deyan
Telerik team
answered on 18 Apr 2012, 11:14 AM
Hi Mauro,

Yes, we have been able to reproduce it in ways, different from what you have described. The issue is caused by special viewport calculations that did not happen in a particular case.

The planned IB that will contain the fix will be released today and you will be able to check it out. 

Regards,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mauro
Top achievements
Rank 1
answered on 18 Apr 2012, 11:41 AM
Hey Deyan,

Thanks very much...I'm really impressed by your fast turn around time :)

Thanks so much for sorting the issue out :)

Regards,
Mauro
0
Deyan
Telerik team
answered on 19 Apr 2012, 07:22 AM
Hello Mauro,

Our latest IB has been published.

You should be able to find it in the Downloads section of your Telerik account.

Check it out and let us know in case you notice something as this is just an Internal Build that has not been entirely tested.

Thanks for your time.

Greetings,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DataBoundListBox
Asked by
Mauro
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Mauro
Top achievements
Rank 1
Share this question
or