Listview columns

T

T S

I am having a problem with columns in listview. The data I have will only
populate one column and I want it to fit on a 3 column page. (once the first
column is full I want it to move on to the next column then to the 3rd and
then to the next page after that).
Can someone point me to the right direction?
Thank you
 
P

Peter Duniho

T said:
I am having a problem with columns in listview. The data I have will
only populate one column and I want it to fit on a 3 column page. (once
the first column is full I want it to move on to the next column then to
the 3rd and then to the next page after that).
Can someone point me to the right direction?

That doesn't sound like something you'll easily be able to use the
ListView class for. The non-"Details" views for ListView all do
something _like_ that, but AFAIK you don't get to control the primary
direction nor the number of columns (at least, not directly).

Instead, you might try the FlowLayoutPanel. It's not as fancy as
ListView in terms of its flexibility, but it _does_ provide exactly the
kind of "fill in the grid" behavior you seem to be asking about.

Pete
 
F

FGoller

T said:
I am having a problem with columns in listview. The data I have will
only populate one column and I want it to fit on a 3 column page. (once
the first column is full I want it to move on to the next column then to
the 3rd and then to the next page after that).
Can someone point me to the right direction?
Thank you

Hi,
What about an int counter variable for example itemcount?

int x = itemcount / maxrows;
int y = itemcount % maxrows;

x is the column inside the listview 0=item;1=subitem0;2=subitem1
y is the row of the listview

If you use an ArrayList as master you have the counter variable and you
are able to insert new items dynamically.
 
J

Jeff Johnson

I am having a problem with columns in listview. The data I have will only
populate one column and I want it to fit on a 3 column page. (once the
first column is full I want it to move on to the next column then to the
3rd and then to the next page after that).
Can someone point me to the right direction?

Use a grid instead.
 

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