by
Roland Schumacher alias GENiALi
17. März 2009 -- 126
words -- 1 mal gelesen
ASP.NET is not just my world. I must again remember that.
Earlier. I have a GridView that I embed an object. The object has some properties of type DateTime. These properties can be predefined with DateTime.MinValue. This looks then but pretty dumb in the GridView.
I thought there's sure a property where you can set in the GridView. Well, not there. You can solve it as follows.
From the field an ItemTemplate make and with an if verify there is a DateTime.MinValue. Looks like this.
< ItemTemplate >
< asp: label ID = "Label1"
runat = "server"
-"--.-"-.-: Eval("DateFrom",_"{0:d}") % > ' > < / asp: label > < / ItemTemplate >
Result:
Thousand thanks goes to Thomas.
cde59165-0d92-48d8-9d30-84f9f346a3ec|0|.0
Tags: