What control to use?

K

kvenku

Hi,
I need a control like listview control with column headers. I hav
difficulty in listview where i cannot change the color of each row an
also find that there is no sorting indication.

Is there any control which have column headers, Sorting indication.

For eg

name age dob
John 30 12/12/74
Ajay 20 1/1/84

where the first row should be in red font and second row in blue.

Sorting indication must me there

If any one knows about this. It will very helpful to me

Thanks
Venkatesh
 
S

Stephen Bullen

Hi Kvenku,
I need a control like listview control with column headers. I have
difficulty in listview where i cannot change the color of each row and
also find that there is no sorting indication.

Is there any control which have column headers, Sorting indication.

Sure. Use the ListView control from the Windows Common Controls
collection, which should be installed on most PCs.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 
K

kvenku

Thanks but in listview i have problem where i cannot color each row an
there is no sorting indication like ascending ot descending( the icon
are not available up arrow and down arrow.)

So is there any other control?

Regards

Venkatesh
 
S

Stephen Bullen

Hi Kvenku,
Thanks but in listview i have problem where i cannot color each row and
there is no sorting indication like ascending ot descending( the icons
are not available up arrow and down arrow.)

So is there any other control?

Just to make sure, I'm not talking about the normal MSForms list box, but
the Windows Common Controls ListView control. In that control, you can
set the color of each row and change the caption of the list header to
indicate a sort order.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 
K

kvenku

Thank you again for the information. But i have a question?
I tried in listview for changing the font color for each row.

for example:
1st row is blue color - works fine
2nd row in green color - 1st row and 2nd row are in green color.

So. only one color can be done in listview. I need to maintain atleas
2 colors in listview at a time.

For sorting can you give me some example of which column in sorted an
in what order.


Thanks
Venkatesh
 
S

Stephen Bullen

Hi Kvenku,
Thank you again for the information. But i have a question?
I tried in listview for changing the font color for each row.

for example:
1st row is blue color - works fine
2nd row in green color - 1st row and 2nd row are in green color.

So. only one color can be done in listview. I need to maintain atleast
2 colors in listview at a time.

ListView1.ListItems(0).ForeColor = vbBlue
ListView1.ListItems(1).ForeColor = vbGreen
For sorting can you give me some example of which column in sorted and
in what order.

It's not automatic. You'd have to handle the click event for the column
header, sort the list and change the caption of the column header to
match.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 
K

kvenku

Hi

I tried using your code as said. But Now i am getting "Compile error
Method or Datamember not found".

I am using Windows common controls 5.0(SP2). My excel version is 2000.

Please help me on this

Thanks

Venkatesh
 
S

Stephen Bullen

Hi Kvenku,
I tried using your code as said. But Now i am getting "Compile error !
Method or Datamember not found".

I am using Windows common controls 5.0(SP2). My excel version is 2000.

That would be why <g>. I'm using the Microsoft List View Control 6.0,
found in the file MSCOMCTL.OCX, which has more functionality than the one
you're using from comctl32.ocx

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie
 

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