This is my DataList code , I define a table in headertemplate and close it in footerTemplate.
The problem is with AlternatingItemStyle and ItemStyle that they don't effect.
If i move the table defenition inside <ItemTemplate>
it does work.
<asp:DataList ID="DataList1" runat="server" DataKeyField="ProductID"
DataSourceID="ObjectDataSource1" EnableViewState="False"
onitemdatabound="DataList1_ItemDataBound" Width="474px">
<AlternatingItemStyle CssClass="AlternatingRowStyle" />
<ItemStyle CssClass="RowStyle" />
<HeaderTemplate>
<table cellspacing="0" cellpadding="0">
</HeaderTemplate>
<ItemTemplate>
<div id="Comment">
<tr>
<div id="Data1">
<td>
<asp:CheckBox ID="CheckBox1" runat="server" />
</td>
<td>
<asp:CheckBox ID="CheckBox2" runat="server" />
</td>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Eval("CategoryName") %>' />
</td>
</div>
</tr>
<tr>
<td></td>
<td></td>
<td>
<asp:Label ID="CategoryNameLabel" runat="server" Text="dfgfdgdg" />
</td>
</tr>
</div>
</ItemTemplate>
<FooterTemplate> </table></FooterTemplate>
</asp:DataList>