Results 1 to 2 of 2

Thread: How to - DataList, FindControl, HTMLTableCell [Resolved]

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    How to - DataList, FindControl, HTMLTableCell [Resolved]

    My WebControls.DataList contains an HTML Table (5 rows, 3 cols) with either an ASP Label, Image or HyperLink in the cell. Using this FindControl code in the DataList_ItemDataBound event , I can modify the properties of these controls no problem.

    Code:
    Dim CompanyLink As HyperLink = CType(e.Item.FindControl("hlnkCompanyName"), HyperLink)
    
    CompanyLink.Text = oData("CompanyName")
    But I am trying to set the Background property of a specific cell depending on the contents of a field. However, I can't seem to "find" the HTMLTableCell that I need to modify using

    Code:
    Dim LinksCell As HtmlTableCell = CType(e.Item.FindControl("tdLinksCell"), HtmlTableCell)
    The LinksCell variable is always nothing. Anyone know how this works?
    Last edited by brucevde; Jul 11th, 2004 at 11:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width