DataList Alternate Style

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am unable to get the data list to render the AlternateStyle.... Any ideas as to why?

<Table title="Calendar Maintenance" >
<asp:datalist id="dlCalendar" runat="server" OnItemCreated="OnItemCreated"
GridLines="Both" CellSpacing="2"
DataKeyField="Time_ID"
OnUpdateCommand="CalendarOnUpdate"
OnEditCommand="CalendarOnEdit"
OnCancelCommand="CalendarOnCancel">
<EditItemStyle ForeColor="Black" BackColor="#99ccff"></EditItemStyle>
<ItemStyle BackColor="#99bbff"></ItemStyle>
<AlternatingItemStyle ForeColor="Black"
BackColor="#ffff33"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True"></HeaderStyle>
....
.....
</asp:DataList></Table>
 
Jim said:
I am unable to get the data list to render the AlternateStyle.... Any
ideas as to why?

<Table title="Calendar Maintenance" >
<asp:datalist id="dlCalendar" runat="server"
OnItemCreated="OnItemCreated" GridLines="Both"
CellSpacing="2" DataKeyField="Time_ID"
OnUpdateCommand="CalendarOnUpdate"
OnEditCommand="CalendarOnEdit"
OnCancelCommand="CalendarOnCancel">
<EditItemStyle ForeColor="Black"
BackColor="#99ccff"></EditItemStyle> <ItemStyle
BackColor="#99bbff"></ItemStyle> <AlternatingItemStyle
ForeColor="Black"
BackColor="#ffff33"></AlternatingItemStyle> <HeaderStyle
Font-Bold="True"></HeaderStyle> ...
....
</asp:DataList></Table>

I'm guessing it has to do with the <table> around the DataList.
Do you use <td> tags in your item templates?
If so, they will override the style applied in the <td> tags
generated by the datalist, because that's where the
itemstyle and alternatingitemstyle go.
 
Back
Top