views:

31

answers:

3

Hey all,

I have a class that returns a list of "Category" Objects. I'd like to display them along the left-hand side of the page in a listview (if that's the best way to do it, even).

The category objects have normal attributes. Title, User, NumberOfProjects. I'd like to display both the title and the number of projects in this list.

Not worried about editability right now as we might make that separate (i.e. not in-line in a list view edit mode).

What do you think is the best way to do this?

Thanks in advance for any help you can give! :)

A: 

First if the array of the objects is too big I'd recommend to use virtual mode of ListView. Second, nice way to "convert" youur object to string is to override ToString method where you can represent info of your object.

Arseny
A: 

One alternative is to bind your collection to a DataGridView and display that, which would save you having to load each item manually but looks tacky and like it was made in Access.

Personally, I'd use a list view as you've suggested. I find that although you have to load its items manually, its simple and looks by far the most professional.

w69rdy
A: 

Hey all,

I was just looking for the best way to use a ListView control, I suppose.

I was able to figure it out -- I wasn't using correctly and hadn't included a "contentPlaceholder" element.

After doing this, I was able to use <%#Eval("FieldName")%> to insert the object's properties into labels. It was already in list format, so the databind was a snap.

If code would benefit anyone else, I'll post it -- I just didn't feel like cutting out all the extra CSS. ;)

Thanks to everyone who tried to help with this!

goober