How can you provide an alternating color scheme in a
Repeater control?
Answers were Sorted based on User's Feedback
Answer / rey vegafria
in UI...
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<tr bgcolor="<%#getColor()%>">
<td align="center"><%#Container.DataItem("name")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
in Source Code...
Partial Class _Default
Dim strColor As String = "#ffffff"
...
Function getColor()
If strColor = "#ffffff" Then
strColor = "#E0F4F8"
getColor = "#ffffff"
Else
strColor = "#ffffff"
getColor = "#E0F4F8"
End If
End Function
End Class
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / aadesh kumar
AlternatingItemTemplate Like the ItemTemplate element, but rendered for every other row (alternating items) in the Repeater control. You can specify a different appearance for the AlternatingItemTemplate element by setting its style properties.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is data cache in sql server?
To match the two different controls which control would we use ?
what is the deference between dataset and data adapter?
How many types of session in asp.net2.0
28 Answers ABC, DOT, First Europa, HCL, iRely, TCS,
What are the advantages and limitations of query string?
Difference between Response.redirect vs server.transfer?
Explain weak typing and strong typing.
How can we identify that the Page is Post Back?
What is the difference between Trace and Debug?
What is the difference between adding reference in solution explorer and adding references by using ?
What is server side in asp.net?
What is the difference between “Web.config” and “Machine.Config”?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)