2017-08-07 54 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