DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us