2017-08-07 33 views
0

其實我沒有得到任何使用嵌套中繼器asp.net c#的邏輯。嵌套中繼器使用c#asp.net web窗體

下面是我的SQL表

DocID Title    FileAttachment      Session 
69053 s3 time table  s3 time table_UserDetails.xls  Session-3 
1616 Notice    Notice_UserDetails.xls    Session-1 
67792 recruiment   recruiment_UserDetails.xls   Session-2 
1616 Tesing    Testing_UserDetails.xls    Session-1 

我想輸出像嵌套Repeater明智的數據會話下面。

Session-1 
    Notice    Notice_UserDetails.xls    Session-1 
    Tesing    Testing_UserDetails.xls    Session-1 
    Session-2 
    recruiment   recruiment_UserDetails.xls   Session-2 
    Session-3 
    s3 time table  s3 time table_UserDetails.xls  Session-3 

或任何其他邏輯來實現上述輸出和會話-1應當由升序會話-1,會話2和會話-3是一階。

+0

關於上述問題的任何想法? @Habeeb – zahed

回答

0

我建議從SQL數據庫中查詢「Session」列中的GROUP BY。 然後在轉發器中有一個您需要的樣式的定製模板(包含會話名稱的每個組的標題)。

查找下面的鏈接,以便參考如何按數據分組並在Repeater中使用它。 您必須根據您的要求進行定製。但是你會明白如何前進。

http://www.dotnetcurry.com/ShowArticle.aspx?ID=206

+0

如果你用代碼發佈答案,那麼它會有幫助,以及中繼代碼如何? @Habeeb – zahed

+0

@zahed,請參閱此鏈接以瞭解前進的想法。 http://www.dotnetcurry.com/ShowArticle.aspx?ID=206 – Habeeb

+0

此鏈接是否適合轉發? https://stackoverflow.com/questions/6171861/how-to-nest-repeaters-in-asp-net?rq=1。@ Habeeb – zahed