header needs to repeat for each row in datalist

I have a datalist that works fine, but I want the header to repeat for each row.

<div id="chks">
   <asp:datalist  id="datalist1"
    runat="server"
    RepeatColumns="2"
    RepeatDirection="Horizontal"
    RepeatLayout="table">

what I get...
header: col1, col2, col3, col4
             col1, col2, col3, col4

what I want....
header1: col1, col2, col3, col4
header2: col1, col2, col3, col4

Any suggestions?
sl1ngerAsked:
Who is Participating?
 
sl1ngerConnect With a Mentor Author Commented:
I had to add a ItemDataBound to get this to work, but when I added the header to the datalist.. this broke...

    Protected Sub datalist1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles datalist1.ItemDataBound
        Static count As Integer
        count += 1

        If e.Item.FindControl("lblResults") IsNot Nothing Then
            If count = 3 Then
                CType(e.Item.FindControl("lblResults"), Label).Visible = False
            End If
        End If



    End Sub
0
 
Salim FayadCommented:
You have to include the header in your datalist.

For better assistance, please include the aspx code of your datalist (and not the asp.cs code)
0
 
sl1ngerAuthor Commented:
I'm not getting an error I think it's just looking at the first template, which is now headertemplate, instead of the itemtemplate.   The itemtemplate is the one holding the lblResults
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Salim FayadCommented:
Can you put your aspx code?
0
 
newbie_girlCommented:
sl1inger, did you resolve this? I'm trying to do the same thing
0
 
sl1ngerAuthor Commented:
Yes, I was able to write it back thru the databoud peice
0
All Courses

From novice to tech pro — start learning today.