471,056 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,056 software developers and data experts.

just can't figure this out

I've been banging my head on this for days and can't get it working. If i
can't get it by today then i'm done with it.
I have a datalist that has a table in it

<asp:datalist id=dl1>
<itemtemplate><table id=vechicle>
<tr>
<td>dataitem</td>
</tr>
</table>
</itemtemplate>
</aspdatalist>
and this displays in the datalist nicely formatted etc. and the data is in
seperate tables within the DL. NOW the part i can't get working. I need to
change the background color of the table(s) based on the dataitem.
I can do this on a label with ctype(e.item.findcontrol(""), label) in the DL
itemdatabound routine

but when i try this with a table i get an error, can't find object or
reference and breaks at the table code:
dim table as table = CType(e.item.findcontrol("tablename"), table)
table.backcolor = color.yellow

and it breaks, any suggestions on how i can do this?
Nov 18 '05 #1
1 2019
It looks like you are using an HTML table control and not a table web
control. There is no backcolor for an HtmlTable control. Backcolor would be
used if this was a Table Web Control. Instead, use bgcolor and try casting
as an HtmlTable instead.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
I've been banging my head on this for days and can't get it working. If i
can't get it by today then i'm done with it.
I have a datalist that has a table in it

<asp:datalist id=dl1>
<itemtemplate><table id=vechicle>
<tr>
<td>dataitem</td>
</tr>
</table>
</itemtemplate>
</aspdatalist>
and this displays in the datalist nicely formatted etc. and the data is in
seperate tables within the DL. NOW the part i can't get working. I need to
change the background color of the table(s) based on the dataitem.
I can do this on a label with ctype(e.item.findcontrol(""), label) in the
DL
itemdatabound routine

but when i try this with a table i get an error, can't find object or
reference and breaks at the table code:
dim table as table = CType(e.item.findcontrol("tablename"), table)
table.backcolor = color.yellow

and it breaks, any suggestions on how i can do this?

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Brian Blais | last post: by
7 posts views Thread by GeorgeAtkins | last post: by
19 posts views Thread by John Salerno | last post: by
9 posts views Thread by Francois Grieu | last post: by
reply views Thread by Frank | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.