Why doesn't the CssClass property change the visual display of my datagrid cells?

R

RJ

Why doesn't the CssClass property change the visual display of my datagrid
cells? Thanks for any insights. I'm primarily a developer of .NET business
components, and weak in ASP.NET, so I may very well be missing some key
ingredient here.

' Yes, the ItemDataBound event is handled for each row in datasource......
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound

' Yes, FormatCells does get called for each row.....
FormatCells(sender, e)



Protected Sub FormatCells(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs)

' Yes, this line of code is executed, but has no visual effect when the
datagrid is displayed.
' What more must I do to have this CssClass apply?
e.Item.CssClass = "MyWarning"
..
..
..
' Yes, In Styles.css the class is defined....

..MyWarning
{
color: red;
}
 
E

Eliyahu Goldin

It looks ok. You might have another style overriding the one you are
setting.

Eliyahu
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top