Handle RowDataBound (or ItemDataBound) event. For ever row item check the
value in the data field (available via DataItem property). If it is null,
set the required cell (available via Cells property) text to blank.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"ken s" <> wrote in message
news:B54A7257-8F3B-41E5-BDC5-...
> Greetings,
> I'm using a custom date format to display date values in a BoundField in a
> GridView. Here's the line that formats the date value:
>
> DataFormatString="{0:MM/dd/yy}"
>
> It works fine as long as there's a date in the field being displayed. But
> if the field is null, it displays 01/01/01. I'd prefer that it either
> show a
> blank field when it's null. How can I do this?
>
|