find by index in Generics

  • Thread starter Thread starter ruthie
  • Start date Start date
R

ruthie

Hi,

I created a generics list:
List<FileView> updatedfilesArr =
(List<FileView>)DataListFiles.DataSource;

and I would like to find an item in the list according to a given
index of the item in the list.

Is there a simple way to achieve it ?


Thanks so much.

Ruthie.
 
Hi,

I created a generics list:
List<FileView> updatedfilesArr =
(List<FileView>)DataListFiles.DataSource;

and I would like to find an item in the list according to a given
index of the item in the list.

Is there a simple way to achieve it ?

Thanks so much.

Ruthie.

Hi Ruthie,

You can use the index operator of the list.

updatedfilesArr[index]

If that's not what you meant, feel free to ask :).

Moty
 
I created a generics list:
List<FileView> updatedfilesArr =
(List<FileView>)DataListFiles.DataSource;
and I would like to find an item in the list according to a given
index of the item in the list.
Is there a simple way to achieve it ?
Thanks so much.

Hi Ruthie,

You can use the index operator of the list.

updatedfilesArr[index]

If that's not what you meant, feel free to ask :).

Moty


Dear Moty,

Great !!

So simple - I spent some time for looking for something much
complicated.

Thanks a lot.

Ruthie.
 
Hi Ruthie,
You can use the index operator of the list.
updatedfilesArr[index]

If that's not what you meant, feel free to ask :).

Dear Moty,

Great !!

So simple - I spent some time for looking for something much
complicated.

Thanks a lot.

Ruthie.

Hi,

Glad I could help.

The List class has much more search capabilities such as FindIndex and
more Find* methods.

You can look for further information (here of course:) ) and the MSDN
generic list page:
http://msdn2.microsoft.com/en-us/library/d9hw1as6.aspx

Moty
 

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

Back
Top