DataFormatString

M

Meelis Lilbok

Hi

Im using VB and ASP.NET2.

In DataGrid column is use DataFormatString="{0:dd.MM.yyyy}"
but it's not working :((

for example it displays always also 00:00:00 (houers, minutes and seconds)
too.
and wher i change format to MM/dd/yyyy , date's are displayed dd.MM.yyyy
00:00:00

regioanl settings are Estonian, where dateformat is dd.MM.yyyy.

any ideas?


autogeneratecolumns is off.
 
A

Alper OZGUR

If you know which column has date,
try this one
datagrid.columns(ColumnNumber).dataformatstring=Cstr("{0: dd.MM.yyyy}")
 
S

S. Justin Gengo [MCP]

Meelis,

I had the same problem. And it seems fairly common. The solution is to turn
off HtmlEncoding for the column in question. Just set the HtmlEncode
property of the column in question to false.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
E

Eliyahu Goldin

DataFormatString is not good for dates and times. It is intended for
numbers.

You can format dates in either ItemDataBound or PreRender event.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top