Last post Oct 24, 2005 01:17 PM by Luis Abreu
Oct 20, 2005 07:02 PM|kbuchanan|LINK
I want to change the background color of a cell based on data within the row. BUT...I get the following error:
Databinding expressions are only supported on controls. System.Web.UI.WebControls.TemplateField is not a control.
When I attempt this:
ControlStyle-CssClass='<%# Eval("VAdmDtTm") %>'>
I have tried code-behind on all the row events, but I guess this code (which worked in ASP.NET 1.x ibut is no longer valid in 2.0):
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
So - how can I set the cell background color based on data within the row?
Oct 21, 2005 02:26 PM|Luis Abreu|LINK
Oct 22, 2005 04:52 AM|kbuchanan|LINK
Ok - but I but I need to change the color based on the value of data with in the recordset row. For example, this snippet below worked in .net 1.x versions, but it isn't working 2.0 In the code below I look up the value in
the "LobbyRoomDesc" label and change the background color in Cell(0) to either Red or Blue.
Thanks for your time and help!
Oct 24, 2005 01:17 PM|Luis Abreu|LINK