locked
ListView, large datasets and ensureVisible.

    Question

  • Hi !

    I think it may be a bug in calculation of position in ListView.

    I have a listview with a large datasource (about 65 000 records). Each item has a size of 250 x  24 px. 

    while the itemIndex is lower than around 25 000, the method ensureVisible works : the item is in the first visible column of the listview.

    But after, there is a bug with the calculation : 

    - the newPos is calculate.

    - the listView try to scrolls to the item, but the scroll is not good enough ! Therefore the listView requests an other slot in the datasource.

    If i change the size of the item (400x48), bigger is the error..

    Edit :

    With a size of 320 x 240px, a viewport of 1366 x 614px (in disposition i have 1366x614.4 ?!)

    until itemIndex <= 9290,  listView.indexOfFirstVisible works and the itemTemplate works.

    after itemIndex = 9298 : listView.indexOfFirstVisible and itemTemplate don't work  (placeholder gray. Datas have been correctly fetched).

    with itemIndex = 25 000 : listView.indexOfFirstVisible shows me the range [9288, 9297]

    • Changed type tcharlot Thursday, October 18, 2012 9:58 AM
    • Edited by tcharlot Thursday, October 18, 2012 10:43 AM
    • Changed type tcharlot Thursday, October 18, 2012 10:43 AM
    Thursday, October 18, 2012 9:57 AM

All replies

  • Sorry...I don't have an answer for you, but I am curious about performance of the ListView with that amount of data.  I have a feeling that would be really slow.

    Dave


    Dave Paquette @Dave_Paquette www.davepaquette.com

    Thursday, October 18, 2012 4:49 PM
  • Nope : performance are good cause i use data virtualization.

    Friday, October 19, 2012 8:22 AM
  • Hello !

    So i know the origin of my problem.

    Open this msdn's sample with IE10 : http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollWidth.htm

    Open DOMViewer (F12).

    Set the width of the div to a very bigger value as "2815200px";

    It seems there is a max width for an element. So, the scrollWidth is limited too.

    The scrollLeft is based on scrollWidth ( var maxScrollLeft = element.scrollWidth - element.clientWidth).

    In conclusion, the limitation of the  width property causes big error in my listview :/

    PS : in chrome or firefox or IE9, the msdn's example works.


    • Edited by tcharlot Monday, November 5, 2012 11:39 AM test with IE9
    Monday, November 5, 2012 11:31 AM
  • Any thoughts on that from MSFT?
    Monday, November 12, 2012 10:10 PM
  • Apparently not :)
    Thursday, November 15, 2012 4:10 PM
  • Unfortunately, ListView can only support a surface length up to about 1.5 million pixels. Assuming you have a 2 row layout, you should be hitting the limit right around there.

    Monday, December 17, 2012 11:07 PM
  • Hey, how do you even get so many items displayed in the first place in decent speed? Do you use grouping? Where is your data coming from? You say you use data virtualization from what source? Database?
    Tuesday, December 18, 2012 9:15 AM