Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Why doesn't the CssClass property change the visual display of my datagrid cells?

Reply
Thread Tools

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

 
 
RJ
Guest
Posts: n/a
 
      02-18-2005
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;
}


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      02-18-2005
It looks ok. You might have another style overriding the one you are
setting.

Eliyahu

"RJ" <> wrote in message
news:...
> 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;
> }
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
CssClass Property CMM ASP .Net 2 03-20-2006 05:45 PM
When/Should we use CssClass property or Style property? Sky ASP .Net Web Controls 2 10-01-2004 07:38 AM
How to Use the File ".css" in the CSSClass property field Ric Pullen ASP .Net 1 08-05-2004 12:09 PM
Setting CSSClass property of Label control? Mervin Williams ASP .Net 1 04-06-2004 09:38 PM



Advertisments