listview with images in view.details?

  • Thread starter Thread starter Merrit
  • Start date Start date
M

Merrit

Hi all,

I still try to display some data in a kind of table. It didn't work with
a normal listbox as I can't have columns in it (can I?). By drawing
lines with the gdi and showing labels between those lines the
performance was too bad as I had to wait ages to see the resut on screen.

I got the hint to use a listview which was great. I only figured out
that I can't display images if use the details view. Is there any
possibility to have images in the details view? Or does anyone have
another idea how to display data (text and images) that belongs together
in a kind of table row by row and having columns? Or is it possible to
create such a component myself, if yes, please help me with the code
because I don't know how as I'm quite new to c# and the compact framework...

Many thanks in advance for any helpful advise!
Merrit
 
Hey Daniel,

I just looked up the MSDN libraray. It seems to me that having the icon
in front of each row is only possible with the StateImageList property
which is not supported in the Compact Framework?!

Guess I need to start learning to create my own component before I can
go on...

Cheers
Merrit
 
Feel free to create your own control but if your requirement is satisfied by
having an icon per row in the manner I described, then you should know that
the CF listview supports it (as I said).

Create the ListView with View=Details and add columns as you normally do.
Create an ImageList with 16x16 icons. Assign the ImageList to the
ListView.SmallImageList property.
Assign for each listviewitem in the listview an image index to their
ImageIndex property.
Run.

If you still can't get it working post the code that fails for you.

Cheers
Daniel
 
Not so. I know the icon works with the listview because I've done it and
without any native P/Invoke calls. Add an ImageList, then set the
ListViewItem's ImageIndex property.

-Chris
 
Back
Top