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

How to access scroll bar of a dock control?

3 Answers 76 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 09 Feb 2012, 09:56 AM
Hi,

I just want to scroll to a special position after the page include dock control posted back.
I have read the article http://www.telerik.com/help/aspnet-ajax/grid-scroll-to-selected-item.html. But I stil have no idea how to find scroll area of a dock control.

For an example,  when i scroll to the bottom item of the RadListView, and click it, the page will reload and the scrollbar for dock control will go back to top. How can I let it scrolling to the selected item? 

       
<telerik:RadDock ID="RadDock2" runat="server" Skin="Black" Height="300px" Width="200px"
    DockMode="Docked">
    <ContentTemplate>
        <telerik:RadListView ID="RadListView1" runat="server" DataSourceID="SqlDataSource1"
            ItemPlaceholderID="SubsystemContainer" Skin="Black">
            <LayoutTemplate>
                <asp:placeholder id="SubsystemContainer" runat="server" />
            </LayoutTemplate>
            <ItemTemplate>
                <table>
                    <tr>
                        <td style="width: 100%; width: 150px; height: 45px;">
                            <asp:linkbutton id="LinkButton1" runat="server" commandname="Select">
                            <div>
                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("CSNAME") %>'/>
                            </div>
                            </asp:linkbutton>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </telerik:RadListView>
        <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="" selectcommand="">
</asp:sqldatasource>
    </ContentTemplate>
</telerik:RadDock>


Any comment is appriciated. Thanks.

3 Answers, 1 is accepted

Sort by
0
Charles
Top achievements
Rank 1
answered on 13 Feb 2012, 09:20 AM
Would somebody give any idea?
0
Slav
Telerik team
answered on 13 Feb 2012, 05:53 PM
Hello Charles,

You can use the following approach to get the RadDock content container HTML element:
function getDockContentContainer() {
    var dock = $find("<%=RadDock2.ClientID %>");
    return dock.get_contentContainer();
}

Note that the ID of the RadDock control should be set to the one you have configured in your page.

The returned reference to the container element can be utilized in order to set the scrollbar position via the scrollTop property as shown below:
function pageLoad() {
    contentContainer = getDockContentContainer();
    contentContainer.scrollTop = 240;
}

Regards,
Slav
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Charles
Top achievements
Rank 1
answered on 16 Feb 2012, 02:56 AM
Thanks, Slav.

I 'll check to see if this way work for me, and report the result here.
Tags
Dock
Asked by
Charles
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Slav
Telerik team
Share this question
or