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

Autoscroll to an item

1 Answer 65 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 17 Feb 2012, 02:24 PM
I'm working on a project where the user can select a "details view" of an item in the Radgrid.  Upon selection, a new page is displayed with the item's details plus a ListView down the left side of the page with hyperlinks to any of the other items that appeared in the previous RadGrid.  Is it possible to have the ListView autoscroll to the currently selected Item Number?  Please see the attached graphic. 

1 Answer, 1 is accepted

Sort by
0
Accepted
Veli
Telerik team
answered on 21 Feb 2012, 11:00 AM
Hello Jim,

You can try setting unique id attributes the container in every data item in RadListView:

<telerik:RadListView ID="RadListView1" runat="server"
    OnNeedDataSource="RadListView1_NeedDataSource">
    <ItemTemplate>
        <div class="item" id='item<%# Eval("ID") %>'>
...
        </div>
    </ItemTemplate>
</telerik:RadListView>

Once every item container has an ID, you can append the ID of the required item to the URL hash (e.g. http://mydetailspage.aspx#item2.0.0).

Thus, when the page is opened, the listview will be scrolled to the respective item.

Veli
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ListView
Asked by
Jim
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or