Цикл ниже:
Код: Выделить всё
foreach (Row r in rows.Skip(1))
{
string x = r.Elements().ElementAt(0).InnerText;
string y = r.Elements().ElementAt(1).InnerText;
string xy = x + '_' + y;
r.Elements().ElementAt(0).CellValue = new CellValue(xy);
}
Код: Выделить всё
r.Elements().ElementAt(0).CellValue = new CellValue(y);
r.Elements().ElementAt(0).CellValue = new CellValue(x);
Я также попробовал следующее:
Код: Выделить всё
foreach (Row r in rows.Skip(1))
{
string x = r.Elements().ElementAt(0).InnerText;
string y = r.Elements().ElementAt(1).InnerText;
string xy = x + '_' + y;
Cell cell = r.Elements().ElementAt(0);
cell.CellValue = new CellValue(xy);
cell.DataType = new EnumValue(CellValues.String);
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... at-openxml