0
嗨,我說我有一個Gridview,我想在其中顯示有關人的信息。一個BoundField可能如下所示:GridView如何設置綁定域
<asp:BoundField DataField="Age"
HeaderText="Age" />
對於Person對象的簡單屬性,這很好。但是,更復雜的財產呢?假設person對象有一個名爲NameId的屬性。 Names對象包含名字和姓氏。要顯示一個名稱,我嘗試過:
<asp:BoundField DataField="Name.First" HeaderText="First Name" />
但是,這並沒有奏效。有人可以建議你如何做到這一點?