user162558
user162558

Reputation: 259

List<ListviewItem>

Can anyone tell me the meaning and the usage of List<ListViewItem>?

And also the difference between ListviewItem and List<ListViewItem>?

Upvotes: 0

Views: 1153

Answers (3)

johnc
johnc

Reputation: 40223

According to MSDN a ListViewItem is an object that

"Represents an item in a ListView control."

The List<ListViewItem> is a (non-UI related) List of ListViewItems.

See the List<T> documentation at MSDN for an explanation of those, but it's essentially a useful .NET collection of a specified type of item (in this case ListViewItem).

Upvotes: 4

Preet Sangha
Preet Sangha

Reputation: 65496

List<> is a generic list. By putting a type like ListViewItem in the brackets you tell the clr to create a new type that is specifically a list of of ListViewItems. ListViewItem could easily be replaced by another type - say string, to create a list those types, say List<string>.

Upvotes: 4

Ryan Kearney
Ryan Kearney

Reputation: 1071

I would think the second one is a List that consists of ListViewItem where as ListviewItem is just an individual item.

Upvotes: 2

Related Questions