如果你沒有定製卻爲課程創建的類,創建以下文件:
[ScaffoldTable(true)]
[MetadataType(typeof(CourseMetaData))]
public partial class Course
{
}
[DisplayName("Courses")]
public class CourseMetaData
{
[DisplayName("Course ID")]
public object CourseID { get; set; }
[DisplayName("Course Name")]
public object CourseName { get; set; }
[DisplayName("Modified By")]
public object ModifiedBy { get; set; }
[DisplayName("Modified By")]
public object ModifiedBy { get; set; }
[DisplayName("Modified On")]
[DisplayFormat(DataFormatString = "{0:MM-dd-yyyy}")]
public object ModifiedOn { get; set; }
[DisplayName("Level Name")]
public object EducationLevelName { get; set; }
}
如果你沒有一個教育層次,抓住這個一個:
[ScaffoldTable(true)]
[DisplayColumn("EducationLevelName")]
[MetadataType(typeof(EducationLevelMetadata))]
public partial class EducationLevel : INotifyPropertyChanging, INotifyPropertyChanged
{
}
[DisplayName("Education Levels")]
public class EducationLevelMetadata
{
[DisplayName("Education Level ID")]
public object EducationLevelID { get; set; }
[DisplayName("Education Level Name")]
public object EducationLevelName { get; set; }
[DisplayName("Education Level Modified By")]
public object EducationLevelModBy { get; set; }
[DisplayName("Education Level Modified On")]
[DisplayFormat(DataFormatString = "{0:MM-dd-yyyy}")]
public object EducationLevelModOn { get; set; }
}
讓我嘗試的是位 – Perpetualcoder 2009-04-15 16:12:10