Re: Field DisplayFormat



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
>
>


.