Link to home
Start Free TrialLog in
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

asked on

How to repeat the data

Hi Experts,

I have the startdate and the enddate. While the startdate is < the end date I have to display the data in the format which I have attached.
All the mealtypes are coming from the database. It is ASP.net and VB.Net
Please help.

Thanks in advance.
screen.png
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Could you please specify your question - it's not really clear what's required?

Is calculating dates your problem?
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

ASKER

Hi Kyle,

Thank u so much for your reply. Actually the date in the header is not coming from database. The Meal type and Meal ID are in a dataset. Do I need to create another datatable putting everything together and then bind it to the repeater control or is there any easy way to do it?

Thanks a lot.
Finally I found a way to do it. I am using nested repeater control. I am collecting all the dates in a dataset and binding that to the outer repeater control and for each row of outer control I am populating the inner repeater control. I got the idea from your code. so thank you very much.
 <table>
              <asp:Repeater ID="outerRepeater" runat="server"  EnableViewState="true">
                <ItemTemplate>
                    <tr>
                        <th>
                            <asp:Label ID="lblStartDate" runat="server" Text='<%#Eval("StartDate")%>'></asp:Label>
                        </th>
                    </tr>
                       
                   
                    <asp:Repeater ID="innerRepeater" runat="server"  EnableViewState="true">
                       
                        <ItemTemplate>
                           
                            <tr>
                                <td>
                                    <asp:Label ID="lblMealTypeID" runat="server" Text='<%#Eval("MealID")%>' ItemStyle-HorizontalAlign="Center"  visible="false"></asp:Label>
                                    <asp:label ID="lblMealTypeName" runat="server" Text='<%#Eval("MealType")%>' ItemStyle-HorizontalAlign="Center"></asp:label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlMenu1" runat="server"></asp:DropDownList>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlMenu2" runat="server"></asp:DropDownList>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </ItemTemplate>
              </asp:Repeater>
              </table>