VBAHole22 Posted February 27, 2004 Posted February 27, 2004 I am trying to format a datalist with a css style. Trouble is i want the first two elements styled one way and the rest another, Like so: Joe Blow 1234 Street Nowhere, NW Do I have to trap the ItemCreated event and handle it that way? If so how do I determine when the item being created is the one I want. The Datalist is: <asp:datalist id=dlstNewMem style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 256px" runat="server" CellSpacing="10" RepeatDirection="Horizontal" RepeatColumns="2"> <ItemTemplate> <table> <tr> <td><%# Container.DataItem( "FirstName" )%> <%# Container.DataItem( "LastName" )%></td> </tr> <tr> <td><%# Container.DataItem( "Title" )%></td> </tr> <tr> <td><%# Container.DataItem( "Phone" )%></td> </tr> <tr> <td><%# Container.DataItem( "eMailLogin" )%></td> </tr> </table> </ItemTemplate> <SeparatorTemplate> <hr> </SeparatorTemplate> </asp:datalist></form> Quote Wanna-Be C# Superstar
*Experts* Bucky Posted February 27, 2004 *Experts* Posted February 27, 2004 Just stick the two items inside a <span> tag: <tr> <td><span style="style goes here"><%# Container.DataItem( "FirstName" )%> <%# Container.DataItem( "LastName" )%></span> </td> </tr> Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
VBAHole22 Posted March 1, 2004 Author Posted March 1, 2004 Don't know why but that isn't getting it done for me. I get no formatting when I apply the span: <asp:datalist id=dlstNewMem style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute; TOP: 256px" runat="server" CellSpacing="10" RepeatDirection="Horizontal" RepeatColumns="2"> <ItemTemplate> <table> <tr> <td><span style="StandOut"> <%# Container.DataItem( "FirstName" )%> <%# Container.DataItem( "LastName" )%></span></td> </tr> <tr> <td><span style="StandOut"><%# Container.DataItem( "Title" )%></span></td> </tr> <tr> <td><%# Container.DataItem( "Phone" )%></td> </tr> <tr> <td><%# Container.DataItem( "eMailLogin" )%></td> </tr> </table> </ItemTemplate> <SeparatorTemplate> <hr> </SeparatorTemplate> </asp:datalist></form> Quote Wanna-Be C# Superstar
VBAHole22 Posted March 1, 2004 Author Posted March 1, 2004 I know that the .css is being recognized on the page because I can apply a style to the entire datalist using CssClass="HeadTwoBlack" but not to different elements using the span Quote Wanna-Be C# Superstar
VBAHole22 Posted March 1, 2004 Author Posted March 1, 2004 muchas gracias amigo Quote Wanna-Be C# Superstar
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.