c# - 如何旋转可编辑网格的行?

标签 c# asp.net-mvc linq entity-framework-5

我需要能够在可编辑网格中输入数据,其中动态列由查找表中的行数决定。这不是实际的例子,但它是我正在尝试做的一个类似的简单案例:

public class Student {
  public long ID {get; set;}
  public string FirstName {get; set;}
  public string LastName {get; set;}
  ...
}

public class Assessment {
  public long ID {get; set;}
  ...
}

public class AssessmentQuestion {
  public long ID {get; set;}
  public long AssessmentID {get; set;}
  public int QuestionNo {get; set;}
  public int PointValue {get; set;}
  ...
}

public class StudentAssessment {
  public long ID {get; set;}
  public long StudentID {get; set;}
  public long AssessmentID {get; set;}
  ...
}

public class StudentAssessmentAnswer {
  public long ID {get; set;}
  public long StudentAssessmentID {get; set;}
  public long AssessmentQuestionID {get; set;}
  public int PointsAwarded {get; set;}
  public string Comments {get; set;}
  ...
}

根据上述结构,学生可以参加给定的评估。我们可以创建 Assessment、AssessmentQuestion、Student 和 StudentAssessment 数据。现在用户正在对评估进行评分,她想查看所有试卷并输入每个学生每个问题的分数。因此,为了最大程度地方便使用,评分者应该看到一个可编辑的网格,每行一个学生姓名,每个问题都有一列,并且他们可以通过 tab 键浏览所有单元格,为每个问题输入要点和评论(如果有)。然后,在点击“保存”时,应该填充 StudentAssessmentAnswer 表。当然,read应该是outer join,因为即使student assessment和question之间没有StudentAssessmentAnswer join,我们还是要入点。

那么,当列数取决于此 AssessmentID 的 AssessmentQuestion 表中的行数时,如何制作这样的网格?

最佳答案

有几种商业上可用的网格可以做到这一点(某种程度上),即。 Telerik MVC grid :

enter image description here

关于c# - 如何旋转可编辑网格的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16168970/

相关文章:

c# - 如何获取mvc3 Controller 中json数组中的值?

jquery - 如何自定义jquery验证数字格式?

c# - linq 到 xml。读。并分配给 ViewData..noob

c# - LINQ 的摘要行

c# - foreach 哈希表中的项目

c# - 事件处理程序和匿名委托(delegate)/Lambda 表达式

c# - 剑道用户界面 : Selecting panelbar item by item property

c# - Assert.IsInstanceOfType 失败,即使它说两种类型相同

c# - Sitecore 8 MVC ajax调用路由寄存器

linq - 使用 Linq 进行分组