format datagrid

G

Guest

Hello everbody,
I need to display my data like this using asp.net and vb.net
Journals issues MailDate
ActualDate
AAA 1 01/15/04
01/15/04
2 01/16/04
01/16/04
3 01/17/04
01/15/04

BBB 1 01/15/04
01/15/04
2 01/16/04
01/16/04
3 01/17/04
01/15/04

can somebody post suggestions how to proceed with this.

Thanks in advance

regards,
sp
 
K

Karl Seguin

Well, you haven't given us much information about how your data is
organized. My guess is you have a dataset with 2 datatables.

One datatable has a JournalId, JournalName, Issues and MailDate column and
looks like:
1 AAA 1 01/15/04
2 BBB 1 01/15/04

The other table has an ActualDate, Issue, MailDate and JournalId column;

01/16/04 2 01/16/04 1
01/15/04 3 01/17/04 1
01/16/04 2 01/16/04 2
01/15/04 3 01/17/04 2


You would set up a DataRelationship between your first table's JournalId and
your 2nd tables JournalId.

You can then use a nested repeater to cleanly bind the two:

<asp:repeater id="journals" runat="Server">
<headerTemplate>//SET UP TABLE</headerTemplate>
<itemTemplate>
<tr>
<td><#% DataBinder.Eval(Container.DataItem, "Journal") %></td>
<td> </td>
<td><#% DataBinder.Eval(Container.DataItem, "Issues") %></td>
<td><#% DataBinder.Eval(Container.DataItem, "MailDate") %></td>
</tr>
<asp:repeater id="subItems" runat="server DataSource='<%#
((DataRowView)Container.DataItem).CreateChildView("relationshipName")%>'>
<tr>
<td> </td>
<td><#% DataBinder.Eval(Container.DataItem, "ActualDate") %></td>
<td><#% DataBinder.Eval(Container.DataItem, "Issues") %></td>
<td><#% DataBinder.Eval(Container.DataItem, "MailDate") %></td>
</tr>
<asp:repeater>
</itemtemplate>
</asp:repeater>


Something like that..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top