I have a field where I have applied conditional formatting using Custom field setting. The field is a date field in SQL Server. Here is my code.
string color;
if (data["DIAApproval_HH"] == 1) {
color="red";
}else {
color="black";
}
value="<span style='color: " + color + "'>" + value.ToString() + "</span>";
The issue I am having is that I need the date field to show as a short date. I tried changing the code to
value="<span style='color: " + color + "'>" + value.ToShortDateString() + "</span>";
but I am getting the following error message 'runnerDotNet.XVar' does not contain a definition for 'ToShortDateString
I also tried this
value="<span style='color: " + color + "'>" + value.ToString().ToShortDateString() + "</span>";
but I still get an error message.
Any help with this is greatly appreciated.
Thanks!