views:

122

answers:

3

I would like to store and display a list of complex items. Each (graphic) item has to display an image, a list of color chips, a label and an index (a letter). User would also be able to zoom within each item, to show details of the image (on mousewheel),

Items would be presented in a vertical list, scrollable and resizable.

Language is C#, .net2.0, or 3.5 only if necessary.

I'm think about using custom UserControls for items (each one composed of a PictureBox, 2 Labels and a custom UserControl to display color chips). For the list, I really don't know what to choose between a ListBox, a ListView, or a DataGridView, or another one I don't know yet.

I basically would go for a ListBox for its simplicity. Could you help me clarifying the advantages of using other lists?

A: 

Hi,

in your case a custom (third party) list control seems to be the way to go. ListBox, a ListView or DataGridView are rather too limited given your requirements.

Regards, tamberg

tamberg
+1  A: 

If you expect to have a large number of these items, I strongly recommend that you do NOT make each one a UserControl. This is doubly important if you intend to localize and globalize the application at some point. The creation of these items will hinder performance.

Instead, take a lighter weight approach so that the items don't have the overhead of a full-blown control. Assuming that each item will be rectangular, you could easily create a UserControl for painting them, including a scrollbar to scroll.

Jeff Yates
A: 

Thanks for your answers. It's very helpful to me. I'm sorry I didn't mention that the list and its items have to manage drag-dropping with other controls. Then, I suppose that items have to be separate controls. Also, list would be dynamic and would not contain more than 30 items.

So, if I understand your advices, I should create a custom UserControl for the list and one for the item.