var cs = currentCitys.Select((c, i) => new { id = c.CITY_ID, 序号 = (i + 1).ToString(), 城市类型 = c.IS_FOREIGN == "Y" ? "国际城市" : "国内城市", 名称 = c.NAME }).ToList();
BestFitGridViewColumnsWidth(gdcCitySel, cs.ToDataTable(), 1, false, false,false);
var cs = currentCitys.Select((c, i) => new { id = c.CITY_ID, 序号 = (i + 1).ToString(), 城市类型 = c.IS_FOREIGN == "Y" ? "国际城市" : "国内城市", 名称 = c.NAME }).ToList();
BestFitGridViewColumnsWidth(gdcCitySel, cs.ToDataTable(), 1, false, false,false);
来源:https://www.cnblogs.com/mol1995/p/11953344.html