Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi,
i am designing a forum ,i display that in a category and under its questions,i create 2 tables one for category categoryname,id and another one is questions questoin,categoryid,qsid.i didn't find solution to do this, pls any one can tell me.

i want to display that in a grid view
like

Software forum
Q1
Q2
Q3
Hardware forum
Q1
Q2
Games forum
Q1
Q2

Thank u
Posted
Comments
Johnny J. 25-Mar-11 6:13am    
What have you done so far? Please ask a more specific question...
Mahendra.p25 25-Mar-11 6:22am    
try repeater with nested repeater

1 solution

try this.

XML
<asp:Repeater ID="rep1" runat="server">
           <HeaderTemplate>
           </HeaderTemplate>
           <ItemTemplate>
               <table width="100%" border="1">
                   <tr valign="top">
                       <td valign="top" width="5%">
                           [Category]//Bind data from database
                       </td>
                     </tr>
                      <tr>
                       <td valign="top" width="95%">
                           <asp:Repeater ID="innerRep" runat="server" OnItemDataBound="Inner_rep_ItemDataBound">
                               <ItemTemplate>
                                   <table width="100%">
                                       <tr>
                                           <td width="9%">
                                              [ Questions] //Bind data from database
                                           </td>
                                       </tr>
                               </ItemTemplate>
                               <FooterTemplate>
                                   </table>
                               </FooterTemplate>
                           </asp:Repeater>
                       </td>
                   </tr>
           </ItemTemplate>
           <FooterTemplate>
               </table>
           </FooterTemplate>
       </asp:Repeater>



Code Behind coding try out by yourself i have just given u an idea.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900