This topic is locked

Conditional Formatting with 50+ Columns (has value)

11/27/2024 1:32:47 PM
ASPRunner.NET General questions
G
gluckett author

I am looking for a way to use Conditional Formating with a table of 50+ columns, but I just want to check if the value is not null and make the cell's colour green.

Is there a way to ask for the value of any cell without explicitly naming the column?

thanks

Sergey Kornilov 11/27/2024

You definitely can. Depending on what event you use, you can iterate through values or data array and inspect values of each elements.

G
gluckett author 11/28/2024

Hmm,
something like this in the BeforeMoveNextList

int n;
String columnName;

For n = 0 to data.Fields.Count - 1
columnName = data.Fields(n).Name;

if (data[columnName].length > 1)
record[columnName+"_css"]+="background:green";
Next n