|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Why doesn't the CssClass property change the visual display of my datagrid cells?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; } It looks ok. You might have another style overriding the one you are
setting. Eliyahu Show quoteHide quote "RJ" <R*@PostOnly.com> wrote in message news:eToifTWFFHA.2156@TK2MSFTNGP10.phx.gbl... > 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; > } > >
Adding "delete" functionality in DataGrid - without a ButtonColumn
Add additional row into header? bound columns of a datagrid How To Insert ASP.NET User Control into DataGrid Column? Need to Format a zipcode into xxxxx-xxxx. Datagrid colum has no Dataformat property Add header text dynamically in a datagrid with templatecolumns? Can we put ActiveX Control into the DataGrid Column? Printer-Friendly DataGrid option How to set cell background based on cell value when datagrid is displayed |
|||||||||||||||||||||||