Igor Igor - 11 months ago 53
C# Question

How add ArrayList to listview1 in c#

I have an ArrayList

while (reader.Read())
decimal nr_zbor = reader.GetDecimal(cod_zbor);
string airport = reader.GetString(name_aeroport);
string company = reader.GetString(name_company);

and I wish to put in the listview columns[zbor,airport,company], but I don't now how

fly = searchFly.GetFly(direction, country, theDate, DFlexible);

can you help me?

Answer Source

One option is to create a class with those 3 properties

class nac
   public decimal nr_zbor ...
   public string airport ...
   public string company ...

List<nac> nacs = new List<nac>();

Those properties are the columns

ListView Class