Replacing a Dateline with "-" in gridview

Hi everyone, I have a question that i like to seek some help. Currently, below is part of my gridview code to display a datetime for a field "CallClosed" in my SQL database.

<asp:TemplateField HeaderText="Call Closed" >
                    <%# (DateTime)Eval("CallClosed") < (new DateTime(1980, 1, 1)) ? "" : ((DateTime)Eval("CallClosed")).ToString("dd/MMM/yyyy  HH:mm")%>

How do i rewrite the statement to replace each field in dd/MMM/yyyy HH:mm with "-" if the datetime is 01/01/1980, else otherwise just display the datetime from my database in the gridview.

Many Thanks!
Who is Participating?
JeremyLMConnect With a Mentor Author Commented:
Hi thanks. I managed to kinda get around it. Instead of showing '-', I make it show blank when the date is 01/01/1980 via

  <%# (DateTime)Eval("CallClosed") == (new DateTime(1980, 1, 1)) ? "" : ((DateTime)Eval("CallClosed")).ToString("dd/MMM/yyyy  HH:mm")%>

Just query it like

JeremyLMAuthor Commented:
Solve myself
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.