ListView and scrollbars

R

rdilipk

I have been running into an issue at work. I have a ListView control
that displays some data in the row/column details format. One column
sometimes has data that can be split into multiple lines.

My problem is when I have items that exceed the displayable area of
the list view, the scroll bar doesn't automatically show up. I have
to either click on the last viewable item (in case it is partially
obscured) or use the arrow keys to scroll past the last viewable item
in order for the scroll bar to appear.

What would cause this behaviour?

I realize I am not posting any code but I am not exactly sure what to
post right now.
 
D

Dilip

I have been running into an issue at work.  I have a ListView control
that displays some data in the row/column details format.  One column
sometimes has data that can be split into multiple lines.

My problem is when I have items that exceed the displayable area of
the list view, the scroll bar doesn't automatically show up.  I have
to either click on the last viewable item (in case it is partially
obscured) or use the arrow keys to scroll past the last viewable item
in order for the scroll bar to appear.

What would cause this behaviour?

Ok.. so I found out what the problem is but I can't really figure out
what sort of code can make it happen. I realized that scrollbars show
up when:

myListView.ClientSize.Height < ((myListView.Items.Count + 1) *
(mylistView.Items[0].Bounds.Height))

What is irritating is myListView.ClientSize.Height remains greater
even when some items drop out of the listview's displayable area.

I can't figure out how that can happen!

Any insights?
 
J

Jeff Gaines

Any insights?

I had a problem like this once and all it was was that the ListView was
docked in a way that put part of it behind another control. It's a long
shot but you could un-dock it, bring to front and re-dock it.
 

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