我有这个手册在网格中添加数据或行,我想问一下如何在vb.net中实现数据绑定。
memberGrid.Rows.Clear()
For Each m As Member In members
Dim row As Object() = {m.MemberId, EntityHelper.FullName(m.Person.FirstName, m.Person.SurName),
WorkoutLogic.GetLastWorkoutDateDisplay(m.MemberId, AppRuntime.Workouts),
LogicService.GetMembershipStatus(m.MembershipHistories),
m.Person.Mobile}
memberGrid.Rows.Add(row)
Next
答案 0 :(得分:0)
尝试类似
的内容memberGrid.DataSource = (From m In members
Select New With { Id = m.MemberId,
FullName = EntityHelper.FullName(m.Person.FirstName, m.Person.SurName),
LastWorkout = WorkoutLogic.GetLastWorkoutDateDisplay(m.MemberId, AppRuntime.Workouts),
Status = LogicService.GetMembershipStatus(m.MembershipHistories),
Mobile = m.Person.Mobile }).ToList()
更改=
之前的名称以匹配列的名称。