次のようなオブジェクトがあります。
public class TestData
{
public string FirstName {get; set;}
public string LastName {get; set;}
public string Email {get; set;}
public string Phone {get; set;}
}
そのクラスの 10 個のインスタンスが に格納されていIENumerable
ます。
GridView
私のファイルにもありaspx
ます:
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
私が必要としているのは、の内容を表示する方法IENumerable
ですGridView
。thead
しかし、テーブルの「タイトル」を自分で設定できるようにしたいです。
だから私はこのようなものを得る:
<table>
<thead>
<th>Firstname</th>
<th>Firstname</th>
<th>Telephone</th>
<th>Email address</th>
</thead>
<tbody>
<!-- the values from each TestData class stored in the IENumberable -->
</tbody>
</table>
でこれを行うことができますか、GridView
それともジョブに他のコントロールを使用する方が良いですか? テンプレートについて何か覚えていますか?よくわかりませんが、私は ASP.NET にかなり慣れていません。