private void AddFieldData(MatrixRow targetRow, int objectId, string objectFieldName, DataMatrix srcData) { var srcRow = srcData.FindRow(objectFieldName, objectId); if (srcRow != null) { for (int srcIndex = 0; srcIndex < srcData.Columns.Count; srcIndex++) { var col = srcData.Columns[srcIndex]; int targetIndex = targetRow.Matrix.IndexOf(col.Name); if (targetIndex >= 0) { targetRow[targetIndex] = srcRow[srcIndex]; } } } }