ListView with Groups don't display all items

L

Luiz Borges

I searched all over the internet for this, I can't believe no one
noticed that before.

Here is the problem, if you have a ListView with lots of items (just
enough get the vertical scroll bar on) and all the items belongs to one
Group (it can be the default Group) you can't navigate to the last two
items using the keyboard (End, Pagedown or Down arrow).

Here how to reproduce this:

1) put a ListView in a form

2) add this code to the FormLoad event

listView1.View = View.Details;
listView1.ShowGroups=true;
listView1.Columns.Add("column");
for (int i=0; i<40; i++) listView1.Items.Add(i.ToString());

3) now just try to get to the last item of the list using your
keyboard...

The same thing also happens in Explorer in Windows, just created a
folder full of files of the same Type and use Show Groups and Detail
mode...

How can I solve this bug????



Luiz Borges
 
L

Luiz Borges

Full code to reproduce the problem:

using System;
using System.Collections;
using System.Windows.Forms;

namespace WindowsApplication
{
public class Form1 : Form
{
private ListView listView1;

static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}

public Form1()
{
ListViewGroup group = new ListViewGroup("ListViewGroup");
this.listView1 = new ListView();

this.listView1.Columns.Add("Column");
this.listView1.Dock = DockStyle.Fill;
this.listView1.Groups.Add(group);
this.listView1.View = View.Details;
this.ClientSize = new System.Drawing.Size(300, 150);
this.Controls.Add(this.listView1);
this.Text = "ListView GroupTest";
this.ResumeLayout(false);
for (int i = 0; i < 40; i++)
listView1.Items.Add(i.ToString());
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top