0
我不知道爲什麼asp.net不會允許訪問的GridView的綁定列包含類的財產,而它的ItemTemplate工作..訪問包含類的屬性綁定列
Class User
{
Diagnosis diagnosis { get; set; } // Contained class
}
Class Diagnosis
{
string DiagnosisCode { get; set; }
}
gridview.datasource =
new List<User>() {
new User() {
diagnosis = new Diagnosis() { DiagnosisCode = "MALARIA" }} }
<boundfield datafield='<#% User.diagnosis.DiagnosisCode %>' />