yes, that's correct. the header and footer templates do not interact with the "row level" data (your records). Only [Alternate]ItemTemplates do.
how is your data structured within the dataset (tables, relations, PK, FK)?
if you have a table of dates, and a table of tasks, and a relation between the 2 you can use [tt]DataRowView.CreateChildView()[/tt].
here is a simple sudo code example. my syntax may be off. I'm writing from scratch
Code:
<asp:Repeater id="myRepeater" OnDataRowBound="myRepeater_DataRowBound">
<HeaderTemplate> Dates: <ol> </HeaderTemplate>
<ItemTemplate>
<li>
<%# Eval("Date", "MM-dd-yy") %>
<asp:Repeater id="mySubRepeater">
<HeaderTemplate> <ol> </HeaderTemplate>
<ItemTemplate>
<li>
<%#Eval("Task") %> - <%#Eval("Name") %>
</li>
</ItemTemplate>
<FooterTemplate> </ol> </FooterTemplate>
</asp:Repeater>
</li>
</ItemTemplate>
<FooterTemplate> </ol> </FooterTemplate>
</asp:Repeater>
protected sub Page_Load(...)
if not page.ispostback then
Me.myRepeater.DataSource = //get dataset
Me.myRepeater.DataBind()
end if
end sub
protected sub myRepeater_DataRowBound(...)
{
if e.item.itemIndex > -1 then
Dim DataRowView row as DirectCast(e.item.DataItem, DataRowView)
Dim repeater as Repeater = DirectCast(e.item.FindControl("mySubRepeater"), Repeater)
repeater.DataSource = row.CreateChildView("[DateToTaskRelation")
repeater.DataBind()
end if
}
the datasource would look like this
Code:
Table 1 "Dates"
-------------
Date DateTime
Table 2 "Tasks"
-------------
Date DateTime
Task string
Name string
Relation "DateToTaskRelation"
-------------
Dates.Date to Tasks.Date
the output would then look like
[ol]
[li]Monday, May 28, 2007:[ol]
[li]Opening - John Doe[/li]
[li]Cooking - Mary Doe[/li]
[li]Prep #1 - [/li]
[li]Cleaning - John Smith[/li][/ol][/li]
[li]Tuesday, May 29, 2007:[ol]
[li]Opening - John Doe[/li]
[li]Cooking - [/li]
[li]Prep #1 - John Smith[/li]
[li]Prep #2 -[/li]
[li]Cashier - Susan Doe[/li]
[li]Cleaning - [/li][/ol][/li]
[/ol]
Jason Meckley
Programmer
Specialty Bakers, Inc.