This approach is related to 13.1. Starting with 13.2, please use the dxList.contentReadyAction event and scrollTo method instead. See the ticket Add the afterRender event to widgets to learn more:
For example:
[JScript]var itemHeight = 23; $("#list").dxList("instance").scrollTo(itemHeight * 12);
Prior 13.2:
dxList does not provide any API that allows scrolling to an item. We can create a dxList inheritor and add the required functionality. This example demonstrates how to add the dataBound event and a method that scrolls content to a specific item index.
[JScript]var MyList = DevExpress.ui.dxList.inherit({ _render: function(){this.callBase();if(this._dataSource){if(this._dataSource._isLoaded && $.isFunction(this.option("dataBound")))this.option("dataBound")(this);}}, scrollToItemIndex: function(index){var elements = this._items();if(elements.length < index || index < 0)return;var itemHeight = elements[0].offsetHeight;this._scrollView.scrollPos(itemHeight * index, true);}}); DevExpress.ui.registerComponent("myList", MyList);
We handle the dataBound event and call the scrollToItemIndex method that was added to our inheritor.
See also:
DevExpress.ui.registerComponent