@{ var DetailDataSource = GetDetailRowsByName(context.Name ?? ""); }

@code { private IEnumerable GetDetailRowsByName(string name) => Enumerable.Range(1, 4).Select(i => new DetailRow() { Id = i, Name = name, DateTime = DateTime.Now.AddDays(i - 1), Complete = random.Next(1, 100) > 50 }); private class DetailRow { [DisplayName("主键")] public int Id { get; set; } [DisplayName("培训课程")] public string Name { get; set; } = ""; [DisplayName("日期")] public DateTime DateTime { get; set; } [DisplayName("是/否")] public bool Complete { get; set; } } }