Adding Style to Repeater Controls in runtime

July 4, 2006

Private Sub Repeater1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles RptGuestNEmployee.ItemDataBound   Dim htmlTblCell As HtmlTableCell

If e.Item.ItemType.AlternatingItem Or e.Item.ItemType.Item Then
htmlTblCell = e.Item.FindControl("tdOutDollars")
If Not htmlTblCell Is Nothing Then
If htmlTblCell.InnerHtml <> " " Then htmlTblCell.Style.Add("color", "green")
End If
End If
End Sub
<TD align="right" nowrap="true" id="tdOutDollars" runat=server> <%# DataBinder.Eval(Container.DataItem,"OutDollars","{0:N}") %> </TD>
Adding Style to Repeater Controls in runtime

posted in ASP.NET by Michael Sync

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org