我只想将e.Trip
my传递string.Format
给tripChoose
. 截至目前,它试图传递一个未针对该方法格式化的字符串。如果我可以传递字符串的 Trip 部分,它会起作用。有什么建议么?
private void LoadExpenseListSums()
{
expenseTotalSelect.Items.Clear();
var sortedList=
from e in roster
group e by e.Trip into expenseCollect
select new { Trip = expenseCollect.Key, SumAmount = expenseCollect.Sum(e => e.Amount) };
foreach (var e in sortedList)
tripChoose.Items.Add(string.Format("{0} | ${1}", e.Trip, e.SumAmount));
}