ASPxClientGridView.SetVerticalScrollPosition(position) Method
Specifies the vertical scroll position for the grid’s content.
Declaration
SetVerticalScrollPosition(
position: number
): void
Parameters
Name | Type | Description |
---|---|---|
position | number | The vertical scroll position. |
Remarks
If vertical scrolling is available within the grid (controlled by the ASPxGridSettings.VerticalScrollBarMode property), the SetVerticalScrollPosition method allows you to scroll the grid’s content vertically on the client side.
Note
The SetVerticalScrollPosition method is not in effect when virtual paging is used (the ASPxGridViewSettings.VerticalScrollBarStyle property is set to GridViewVerticalScrollBarStyle.Virtual).
Example
The example demonstrates how to scroll grid content automatically.
<script type="text/javascript">
var scrollPosition = 0;
function onInit(s, e) {
setInterval(function () {
s.SetVerticalScrollPosition(scrollPosition);
scrollPosition++;
}, 100);
}
</script>
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="CustomersDataSource" KeyFieldName="CustomerID" AutoGenerateColumns="False">
<Columns>
<dx:GridViewDataColumn FieldName="ContactName" />
<dx:GridViewDataColumn FieldName="CompanyName" />
<dx:GridViewDataColumn FieldName="City" />
<dx:GridViewDataColumn FieldName="Country" />
</Columns>
<ClientSideEvents Init="onInit" />
<SettingsPager Mode="ShowAllRecords" />
<Settings VerticalScrollableHeight="200" VerticalScrollBarMode="Visible" />
</dx:ASPxGridView>
See Also