dynamically change table with early binding?

M

Max

For some reason Style is read-only, so this wont work? I was hoping I could
change the style:

<asp:TableCell style="background-image:url(images/header_bottombg.gif)"
Wrap="false" HorizontalAlign="Left" ID="tcMenu1">

tblMenuRow.Cells.Item(1).Style =
"background-image:url(images/header_bottombg.gif)"

Anyway to do this?

-Max
 
N

Natty Gur

Hi,

the collection of styles is read only but you can change style
collection items :

private void DataGrid1_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
e.Item.Cells[1].Style["background-image"] = "url(1.jpg)";
}

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top