If Null change cell colour (Row_Rendered)

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
ashworth81
User
Posts: 11

If Null change cell colour (Row_Rendered)

Post by ashworth81 »

Hi trying to check if null having no luck (C#), checked through all help file and google cant get working.

// Row Rendered event
public void Row_Rendered() {
if (ew_SameStr(Tech.ViewValue, Null))
CellAttrs["style"] = "color: red; background-color: #ccffcc";
}

It is where 'Null' is where I'm having issues. The code works if I put a value e.g. "01/01/2016" but need to change to if null.


motfs
User
Posts: 258

Post by motfs »

ashworth81 wrote:
if (ew_SameStr(Tech.ViewValue, Null))

Just check empty:

if (ew_Empty(<field>.ViewValue)) {
// your code
}


ashworth81
User
Posts: 11

Post by ashworth81 »

Hi Thanks for your help I managed to get this working with :

// Row Rendered event
public override void Row_Rendered() {
if (Tech.ViewValue == "" && Quality.ViewValue == "")
Quality.CellAttrs["style"] = "color: red; background-color: #ccffcc";
}


Post Reply