List of elements extracted with select their own numbers

var cs = currentCitys.Select ((c, i) => new {id = c.CITY_ID, number = (i + 1) .ToString (), urban type = c.IS_FOREIGN == "Y"? "international city" : "cities" name = c.NAME}) ToList ();

BestFitGridViewColumnsWidth(gdcCitySel, cs.ToDataTable(), 1, false, false,false);      

Guess you like

Origin www.cnblogs.com/mol1995/p/11953344.html