public static DCTDataRow FromTableRow(TableRow row, DCTDataColumnCollection colCollection) { List<TableCell> cells = row.Descendants<TableCell>().ToList(); DCTDataRow result = new DCTDataRow(); result.isEmpty = true; for(int i=0;i<cells.Count;i++) { DCTDataColumn column = null; if (colCollection.TryGetValue(i, out column)) { if (!string.IsNullOrEmpty(cells[i].InnerText)) result.isEmpty = false; result[column] = cells[i].InnerText; } } return result; }
public static DCTDataRow FromTableRow(TableRow row, DCTDataColumnCollection colCollection) { List <TableCell> cells = row.Descendants <TableCell>().ToList(); DCTDataRow result = new DCTDataRow(); result.isEmpty = true; for (int i = 0; i < cells.Count; i++) { DCTDataColumn column = null; if (colCollection.TryGetValue(i, out column)) { if (!string.IsNullOrEmpty(cells[i].InnerText)) { result.isEmpty = false; } result[column] = cells[i].InnerText; } } return(result); }