Igor Igor - 1 year ago 84
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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download