我如何在ListView Webcontrol中使用GroupTemplate

时间:2012-10-24 09:03:16

标签: c# asp.net listview datatable

我需要ASP.NET ListView的帮助,我已阅读了很多教程,但我没有找到问题的答案。我试着解释我的问题。

致我的申请:

我使用DataTable和我们的Active Directory中的数据,并使用此DataTable填充我的ListView

 this.myListView.DataSource = //myDataTable
 this.myListView.DataBind(); 

例如,我的DataTable有三个列和几行来自ActiveDirectory的用户信息。

enter image description here

如果我启动ListView,我会得到这个...我的图片和我的ASPX代码是如何......

<ListView ...>
 <LayoutTemplate>
   <table>
    <tr>
     <th> --> Firstname Header
     <th> --> Lastname Header
     <th> --> Location Header
    <tr>
    <tr> --->itemPlaceHolder
   </table>
 </LayoutTemplate>
 <ItemTemplate>
  <tr>
   <td> --> Firstname
   <td> --> Lastname
   <td> --> Location
  </tr>
 </ItemTemplate>
</ListView>

我的想法:

我想如果我展示我的ListView我得到了这个......

enter image description here

为此必须使用GroupTemplate,但我不知道如何构建我可以创建此组的ListView。问题是我必须知道哪个用户拥有该位置,而且我必须构建ListView。

任何人都可以帮助我:(

0 个答案:

没有答案