Feed
Google+
Contact
XING
LinkedIn
Twitter
ICQ
meebo.com

ASP.NET - GridView - display date desire

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.

image

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:

image

Thousand thanks goes to Thomas.

Tags:

Kommentare sind geschlossen

Statistik

Gesamte Posts: 1025
Dieses Jahr: 7
Diesen Monat: 1
Diese Woche: 0
Kommentare: 929
Total Bewertungen: 91
Ø Bewertung: 4,42
Meisten Kommentare
Google+ ... (28)
Beste Ø Bewertung
Tastaturlayout von Visual Stud ... (5)
Meiste Bewertungen
Windows 7 und die ersten Erfah ... (5)

Buttons

Stop Spam Harvesters, Join Project Honey Pot Benutzerprofil von GENiALi connection speed test network connection Bloggeramt.de Slug.ch Blog Verzeichnis und Blog Webkatalog Schumacher Roland Seitwert Valid XHTML 1.0 Transitional

writing