Can anybody help me to print the repeater data with background colors of the cells

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahees
    New Member
    • Aug 2007
    • 4

    Can anybody help me to print the repeater data with background colors of the cells

    Hi all,
    Can anybody help me to print the repeater data from asp.net page? I am binding two columns of the repeater table. It is including the background color, which is fetching from the database. I am really stucked in this. Some javascript functions not printing the color or the table.
    My repeater control is below.
    Code:
    <asp:Repeater ID="repeaterTT" runat="server">
    <HeaderTemplate>
    <Table border="1px" id="tblTT" cellpadding="0" cellspacing="0" style="border-color:Black;" 
    width="100%">
    <tr>
    <th>
    Location</th>
    <th>
    Times</th>
    <th>
    Sunday</th>
    </tr>
    <tr>
    </HeaderTemplate>
    
    <ItemTemplate>
    <tr>
    <td align="center">
    <%# DataBinder.Eval(Container.DataItem, "facility_name")%> 
    </td>
    <td align="center">
    <%# DataBinder.Eval(Container.DataItem, "TT_TIME")%> 
    </td>
    <td align="center" 
    style='background-color:<%# DataBinder.Eval(Container.DataItem, "session_color")%>'>
    <%# DataBinder.Eval(Container.DataItem, "session_sun")%> 
    </td>
    
    </tr>
    </ItemTemplate>
    
    <FooterTemplate>
    </table>
    </FooterTemplate> 
    </asp:Repeater>
    Last edited by Frinavale; Oct 16 '08, 08:20 PM. Reason: added [code] tags
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    What id the problem?
    Everything looks like it should work...except the single quotes you are using when setting the style (line 25).

    It should be:
    [code=asp]
    style="backgrou nd-color:<%# DataBinder.Eval (Container.Data Item, "session_color" )%>">[/code]

    Please remember to use code tags in the future.

    -Frinny

    Comment

    Working...