|
|
|
start date: Wed, 15 Aug 2007 09:48:42 -0300,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Paulo
|
|
2
Ladislav Mrnka
|
|
3
Paulo
|
|
4
Ladislav Mrnka
|
|
5
David Wier
|
|
6
Ladislav Mrnka
|
Doubt BoundField
Why when I put on DataFormatString: {0:dd/MM/yyyy} on a boundfield at the
gridview it lists: 24/01/1981 00:00:00 and I want just Date...
Can you help me ?
C# 2.0 VS 2005 asp.net
Date:Wed, 15 Aug 2007 09:48:42 -0300
Author:
|
RE: Doubt BoundField
Hi Paulo,
what source of data are you using for your grid view? Is it a database? If
so what is returining your query and especially what type is used for your
date type. It has to be DateTime.
Regards,
Ladislav
"Paulo" wrote:
> Why when I put on DataFormatString: {0:dd/MM/yyyy} on a boundfield at the
> gridview it lists: 24/01/1981 00:00:00 and I want just Date...
>
> Can you help me ?
> C# 2.0 VS 2005 asp.net
>
>
>
Date:Wed, 15 Aug 2007 07:26:07 -0700
Author:
|
Re: Doubt BoundField
Thanks for replying, the source came from a sql serve, and the field type is
DateTime...
Thanks
"Ladislav Mrnka" escreveu na
mensagem news:B25E428F-EB1E-4AC6-9AE8-50DBEF066462@microsoft.com...
> Hi Paulo,
> what source of data are you using for your grid view? Is it a database? If
> so what is returining your query and especially what type is used for your
> date type. It has to be DateTime.
>
> Regards,
> Ladislav
>
> "Paulo" wrote:
>
>> Why when I put on DataFormatString: {0:dd/MM/yyyy} on a boundfield at the
>> gridview it lists: 24/01/1981 00:00:00 and I want just Date...
>>
>> Can you help me ?
>> C# 2.0 VS 2005 asp.net
>>
>>
>>
Date:Wed, 15 Aug 2007 11:37:35 -0300
Author:
|
Re: Doubt BoundField
Hi Paulo,
you can use this workaround:
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:Label runat="server" ID="myDate" Text='<%#
((DateTime)Eval("Last_Update")).ToString("dd/MM/yyyy") %>' />
</ItemTemplate>
</asp:TemplateField>
I am using all fields except TemplateField very rarely.
Regards,
Ladislav
"Paulo" wrote:
> Thanks for replying, the source came from a sql serve, and the field type is
> DateTime...
>
> Thanks
>
> "Ladislav Mrnka" escreveu na
> mensagem news:B25E428F-EB1E-4AC6-9AE8-50DBEF066462@microsoft.com...
> > Hi Paulo,
> > what source of data are you using for your grid view? Is it a database? If
> > so what is returining your query and especially what type is used for your
> > date type. It has to be DateTime.
> >
> > Regards,
> > Ladislav
> >
> > "Paulo" wrote:
> >
> >> Why when I put on DataFormatString: {0:dd/MM/yyyy} on a boundfield at the
> >> gridview it lists: 24/01/1981 00:00:00 and I want just Date...
> >>
> >> Can you help me ?
> >> C# 2.0 VS 2005 asp.net
> >>
> >>
> >>
>
>
>
Date:Wed, 15 Aug 2007 08:20:05 -0700
Author:
|
Re: Doubt BoundField
Use {0:d}
also - make sure HTMLEncode property is set to false
David Wier
http://aspnet101.com
http://iWritePro.com - one click PDF/Convert Files to HTML with no bloat
"Paulo" wrote in message
news:OhUD%23qz3HHA.3916@TK2MSFTNGP02.phx.gbl...
> Why when I put on DataFormatString: {0:dd/MM/yyyy} on a boundfield at the
> gridview it lists: 24/01/1981 00:00:00 and I want just Date...
>
> Can you help me ?
> C# 2.0 VS 2005 asp.net
>
Date:Wed, 15 Aug 2007 10:24:07 -0500
Author:
|
Re: Doubt BoundField
Hi again Paulo,
I tryed it at my own and I found a trick :) Set HtmlEncode="false" for your
BoundField.
Regards,
Ladislav
"Paulo" wrote:
> Thanks for replying, the source came from a sql serve, and the field type is
> DateTime...
>
> Thanks
>
> "Ladislav Mrnka" escreveu na
> mensagem news:B25E428F-EB1E-4AC6-9AE8-50DBEF066462@microsoft.com...
> > Hi Paulo,
> > what source of data are you using for your grid view? Is it a database? If
> > so what is returining your query and especially what type is used for your
> > date type. It has to be DateTime.
> >
> > Regards,
> > Ladislav
> >
> > "Paulo" wrote:
> >
> >> Why when I put on DataFormatString: {0:dd/MM/yyyy} on a boundfield at the
> >> gridview it lists: 24/01/1981 00:00:00 and I want just Date...
> >>
> >> Can you help me ?
> >> C# 2.0 VS 2005 asp.net
> >>
> >>
> >>
>
>
>
Date:Wed, 15 Aug 2007 08:32:08 -0700
Author:
|
|
|