Questions tagged [tfield]
11 questions
6
votes
2 answers
Delphi TFloatField.DisplayFormat for numeric fields less than 1.0
This is my procedure.
procedure format_integer_field(Atable: TDataSet);
var i: integer;
begin
if Atable.Active then
if Atable.FieldCount > 0 then
with Atable do
begin
for i:= 0 to FieldCount-1 do
if (Fields[i] is TIntegerField) then
…

Morteza Samie
- 125
- 1
- 1
- 9
5
votes
3 answers
OnValidate for a TClientDataSet
I'm trying to write an OnValidate event on a field on a TClientDataSet, something along the lines of
procedure TForm8.ClientDataSet1MyFieldValidate(Sender: TField);
begin
if Sender.AsFloat > 30 then
raise Exception.Create('Too…

Alister
- 6,527
- 4
- 46
- 70
3
votes
0 answers
TField's Origin property meaning
I have a doubt about the TField's Origin property.
The documentation states:
Origin is only assigned at design time by the Fields editor, and only
when the field component is used by a TQuery object. The Origin
property distinguishes the name…

Fabrizio
- 7,603
- 6
- 44
- 104
2
votes
1 answer
How can I get column's caption in TDBGrid?
How can I get column's caption in TDBGrid?
I've tried this but it returns FieldName instead caption:
DBGrid.Fields[i].DisplayLabel

Dmitry
- 14,306
- 23
- 105
- 189
1
vote
0 answers
tfield.onchange not fired when we reset tfield to oldvalue
the Event tfield.onChange is fired when we update a record but not fired when we reset it to oldvalue ( ex cancelUpdates or simply cancel ) . Can we change this behavior?

user12500624
- 11
- 1
1
vote
1 answer
How to stop TField.Origin from getting reset
I use the TField.origin property to dynamically build a where clause for SQL queries.
So if I have a query such as;
select
p.firstname,
p.lastname,
g.description
from
people p
inner join groups g
I can set the origin of the firstname…

srayner
- 1,799
- 4
- 23
- 39
1
vote
1 answer
Whats wrong with TDateTime value
I have a TDateTime variable called currMonth. currMonth's value is "6/30/2000 11:59:59 PM".
I need to insert currMonth as default value for a field at TDBGrid called dtBegin.
I try this code :
dtBegin->AsDateTime = currMonth;
And the compiler is…

Jessie M
- 498
- 1
- 9
- 23
0
votes
0 answers
cant assign field.value property in a Tfield inside a list Access Violation error always appear how to solve this
i have a Form name brazil and button save(Button3Click) and 4 Tedit field (Edit1Coach,Edit2Vice,Edit3Captain,Edit4Keeper) to Insert values in it
when user click button save this what should happen
procedure TBrazil.Button3Click(Sender:…

Abdelaziz Gohar
- 1
- 2
0
votes
1 answer
How to check the previous value of a field from the OnValidate event handler?
I need to validate the new value of a TField based on the previos value of the field itself.
e.g: the field's value can only be changed to bigger values
procedure TForm1.FldOnValidate(AField : TField);
begin
if(???) then
raise…

Fabrizio
- 7,603
- 6
- 44
- 104
0
votes
1 answer
How can I use Unicode (or just Cyrillic) chars on TStringField.FieldName property on Delphi?
How can I use Unicode (or just Cyrillic) chars on TStringField.FieldName property of TClientDataSet on Delphi?
I've tried this and it doesn't work on the last line:
aStringField := TStringField.Create(aClientDataSet);
aStringField.FieldName :=…

Dmitry
- 14,306
- 23
- 105
- 189
0
votes
2 answers
How to edit Calculated Field value in C++ Builder XE
I have a TDBGrid which shows some calculated fields. I'm use MySQL database.
I need to edit field values of one calculated field called "Date" but I can't.
I try to edit other field called "Description" which have StringField type and it…

Jessie M
- 498
- 1
- 9
- 23