Re: Field DisplayFormat
- From: "Mike Shkolnik" <mshkolnik2002@xxxxxxx>
- Date: Tue, 27 Sep 2005 22:55:08 +0300
Add the next code in AfterOpen event for your TClientDataset:
begin
(Dataset.FieldByName('yourDateFieldName) as TDateTimeField).DisplayFormat
:= 'mm/dd/yyyy'
end
--
With best regards, Mike Shkolnik
E-mail: mshkolnik@xxxxxxxxxxxxx
WEB: http://www.scalabium.com
"Mac Davis" <newsgroups@xxxxxxxxxxxxxx> wrote in message
news:433979c0$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> If I programatically create a ClientDataSet then add a field --
>
> ds.FieldDefs.Add('Date', ftDateTime,0,False);
>
> How do I set the DisplayFormat of the Date?
>
> The DisplayFormat property is available in the Object Inspector when the
> Dataset is a component, but when created programatically I cant find it.
>
> I want the date displayed as mm/dd/yyyy
>
> Thanks,
> Mac
>
>
.
- Follow-Ups:
- Re: Field DisplayFormat
- From: Mac Davis
- Re: Field DisplayFormat
- References:
- Field DisplayFormat
- From: Mac Davis
- Field DisplayFormat
- Prev by Date: Field DisplayFormat
- Next by Date: Re: Field DisplayFormat
- Previous by thread: Field DisplayFormat
- Next by thread: Re: Field DisplayFormat
- Index(es):