在我的员工表中,字段类似于EmployeeID,FirstName,MiddleName,LastName,......就像那样。
我想将像EmployeeID这样的Html.DropDownList绑定为dataValueField,将FirstName + MiddleName + LAstName绑定为dataTextField。我怎么能这样绑定?
答案 0 :(得分:0)
Create a partial class and set a property like this
public string Name
{
get
{
return string.Format("{0} {1} {2}", FirstName, MiddleName, LastName);
}
}
Give 'Name' as the dataTextField