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
ASP.NETVisual Basic.NETC#.NET Programming

Avatar of undefined
Last Comment
RadhaKrishnaKiJaya
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
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.
Avatar of RadhaKrishnaKiJaya

ASKER

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>
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo