日期:2014-05-17 浏览次数:21708 次
foreach (var ts in list)
{
string num = ts.RailwayId.ToString();
ListViewGroup group;
group = lvSeat.Groups[num];
if (group == null)
{
group = new ListViewGroup(num, num + "车厢");
lvSeat.Groups.Add(group);
}
for (int i = 1; i <= ts.SeatCount; i++)
{
ListViewItem item = new ListViewItem(num + "-" + i.ToString());
item.ImageIndex = ts.SeatTypeId;
item.Group = group;
lvSeat.Items.Add(item);
}
}