Grouped ListView and problems with scroll


  • Hello. I found another problem that need/should be resolved. Lets make a grouped ListView controll. Now as datasource put 3 groups, each with 1 item. Run, all works fine.

    Now change datasource to 20 items in first group, 1 in second and 1 in third. Run app, scrollbar should appear. But its totally messed. It uses groups to calculate scroll instead of items. First, very big group of 20 items, take same scroll place as second and third group. Its not usable, after scrolling throught first 19 items, scrollbar is at 1/3 of  place, then scroll one more time and its at end of place...

    More, HidesIfEmpty of group style dont work. group is not showing, but its still taking place at scrollbar. And at end, if you put 3 empty groups with HidesIfEmpty enabled, app is crashing as soon as you move mouse to listview.

    Saturday, July 14, 2012 2:33 PM

All replies

  • This problem is also reproduced at Yours docs here: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh780627.aspx

    Just make first project with 20 activities, and second with 2 activities. Same bug with ScrollBar.

    • Edited by raximus Saturday, July 14, 2012 8:32 PM img
    Saturday, July 14, 2012 8:27 PM
  • Hi raximus,

    I have to say that, yes, I can reproduce your on my side. What I see is that the size of the scrollbar changes when scroll down just as the screenshot show above. I will report this issue to our senior metro style app engineers.

    And for your another issue: if you set the property HidesIfEmpty="True" and put 3 empty groups then your metro style app crash, I can't reproduce it. Can you get the same result once you use the sample in the link you offered above?


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, July 18, 2012 9:33 AM
  • Hello, thx for Your report, i hope it will be fixed to RTM.

    About HidesIfEmpty, yes it happen in my main app and in linked sample too. In linked sample, there are 2 methods of generating groups. First method using list and linq:

    List<Activity> Activities = new List<Activity>();
    var result = from act in Activities group act by act.Project into grp orderby grp.Key select grp;
    cvsActivities.Source = result;

    But grouping empty list will return empty result, so you cant use it to populate empty group.

    Second method use list of list:

    List<Project> Projects = new List<Project>();
    Project newProject = new Project();
    newProject.Name = "Project 1";
    newProject = new Project();
    newProject.Name = "Project 2";
    cvsProjects.Source = Projects;

    This way you can make list of 2 empty projects. And this way app is crashing. Its not throwing any exception, its just freezing, you can only "stop debug" from VS.

    If you still cant reproduce it, i can mail sample solution to you(just give mail). But this bug is not very important as user probably will have empty all groups only at first run of app. More important is behavior with 2 big groups and 1 small(or even empty). 

    Wednesday, July 18, 2012 10:31 AM
  • The behavior of the scrollbar in a grouped GridView is known and a "behavior" limitation that we will have for Windows 8. In essence the scroll bar thumb size is based upon the logic count of items on the screen, not pixel size. Sorry for the problems.

    Program Manager
    This post is provided "as-is"

    Wednesday, July 18, 2012 7:08 PM
  • Is there an easy way to work around this problem?  I am dealing with this same issue.

    I tried putting the ListView inside a ScrollViewer, but the mousewheel (and presumably touch) scroll events are not making it to the ScrollViewer unless the scroll bar itself is targeted.

    Sunday, September 09, 2012 10:02 PM
  • Sry, i unmarked this answer, becouse answer "this bug is feature" is not an answer.

    Like i Daniel said, grouped ListView inside ScrollViewer make this work, but disable scrolling. I test it, touch scrolling works fine, only mouse scrolling. Is there any way to disable scrolling events in ListView?

    Wednesday, September 12, 2012 3:03 PM
  • raximus,

    I am also facing the ScrollBar issue with ListView having grouped items. I tried putting the ListView inside the scrollViewer and now it works. But I am not able to scroll using mouse wheel. I am not sure whether touch scrolling will work or not as I don't have a touch device. Can you please tell me something about touch scrolling?

    • Edited by JordanSmith Wednesday, December 26, 2012 7:22 AM
    Wednesday, December 26, 2012 7:19 AM
  • I am able to solve the Scroll bar issue with grouped items as suggested in the following post.


    • Edited by JordanSmith Thursday, January 10, 2013 7:38 AM
    • Proposed as answer by Hristo Valev Wednesday, August 14, 2013 2:23 PM
    Thursday, January 10, 2013 7:37 AM