Initial Return ScrollViewer in RadListBox

2 posts, 0 answers
  1. Vincent
    Vincent avatar
    10 posts
    Member since:
    Nov 2013

    Posted 04 Feb 2014 Link to this post


    I use RadListBox, and RadButtons to change selectedItem of the List.

    One of these RadButtons (Button 1)  give me the first item of the List. 

    When my selected Item is the last item of my list, and then i click Button1, Selected item is well the first of my list, but the scrollViewer is still at the end of the list.

    I hope it's clear...
    Do you know how i can do an initial return of my scrollViewer? 

    <telerik:RadListBox x:Name="RadListBox" Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Disabled"
                                    ItemsSource="{Binding RechercheResident.PagedSyntheseResidents, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                                    SelectedItem="{Binding RechercheResident.SelectedSyntheseResident, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                           <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                               <GradientStop Color="#FF61B003" Offset="0.049"/>
                               <GradientStop Color="#FFC3FD89" Offset="0.854"/>
                               <GradientStop Color="#FFABE475" Offset="0.271"/>
                               <telerik:RadWrapPanel Orientation="Horizontal" />
                               <Grid Margin="2" VerticalAlignment="Stretch">
                                       <ColumnDefinition Width="50"/>
                                       <ColumnDefinition Width="80"/>
                                   <Image Grid.Column="0" Source="{Binding Photo}" Height="60" Stretch="Fill" />
                                   <StackPanel Grid.Column="1" Orientation="Vertical">
                                       <telerik:Label Margin ="0,0,0,0" Content="{Binding Resident.Titre, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource AgmLabelInputStyle}"/>
                                       <telerik:Label Margin ="0,0,0,0" Content="{Binding Resident.Nom, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource AgmLabelInputStyle}"/>
                                       <telerik:Label Margin ="0,0,0,0" Content="{Binding Resident.Prenom, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource AgmLabelInputStyle}"/>
  2. Kalin
    Kalin avatar
    1360 posts

    Posted 07 Feb 2014 Link to this post

    Hi Vincent,

    I recreated the explained scenario in a sample project, but the ListBox was behaving as expected. When I clicked the button the first item got selected and the ListBox scrolled to the beginning of the items. I'm attaching my project here so you can check it out and let me know if I have missed anything.

    Hope this helps.


    Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

Back to Top