Adding Style to Repeater Controls in runtime.
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
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
<TDalign="right"nowrap="true"id="tdOutDollars" runat=server> <%# DataBinder.Eval(Container.DataItem,"OutDollars","{0:N}") %></TD>
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home