//得到自定义的list
var list = schoolGradeClassModelList.Select(x => new DropDownListData() { DataTextField = x.gradename, DataValueField = x.grade }).ToList();
//新的类
public class DropDownListData
{
/// <summary>
/// 绑定的数据名称
/// </summary>
public string DataTextField { get; set; }
/// <summary>
/// 绑定的数据值
/// </summary>
public object DataValueField { get; set; }
public DropDownListData() { }
public DropDownListData(string dataTexField, string dataValueField)
{
this.DataTextField = dataTexField;
this.DataValueField = dataValueField;
}
}