View Issue Details

IDProjectCategoryView StatusLast Update
0002131JEDI VCL00 JVCL Componentspublic2006-04-05 01:20
ReporterjoszAssigned Toobones 
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 
Target VersionFixed in Version3.30 
Summary0002131: TJvDBSpinEdit Value is always 0 when Field.DisplayFormat=>''
DescriptionWhen for example, Field.DisplayFormat=#'%' then TJvDBSpinEdit.Value is always 0.
Example, Field.Value=4 >>> Field.DisplayText='4%' >> TJvDBSpinEdit.Value=0
To solve this behaviour replace the line in
procedure TJvDBSpinEdit.DataChange(Sender: TObject);
Text := FDataLink.Field.DisplayText;
must be
Text := FDataLink.Field.AsString;
TagsNo tags attached.

Activities

obones

2005-05-20 03:13

administrator   ~0007266

I'm sorry, could you post a sample application, I can't find any Field.DisplayFormat property.
Sorry for the delay answering this.

josz

2005-05-20 06:43

reporter   ~0007273

Sorry, the example had not enough info.
The behaviour exist when the DataField property is the name of a TNumericField or is derived from it.
TNumericField has a DisplayFormat property.

The modified procedure

procedure TJvDBSpinEdit.DataChange(Sender: TObject); { Triggered when data changes in DataSource. }
begin
 if FDataLink.Field <> nil then
 begin
   if Focused and FDataLink.CanModify then
     Text := FDataLink.Field.AsString
     //modified by Jos Zonneveld sept 8, 2004
// Text := FDataLink.Field.Text
     //This is the result of formated values and wil result in Text=0
   else
   begin
     FIsNull := (FDataLink.Field.DisplayText = '');
     Text := FDataLink.Field.AsString;
     //modified by Jos Zonneveld sept 8, 2004
// Text := FDataLink.Field.DisplayText;
     //This is the result of formated values and wil result in Text=0
     if FDataLink.Editing or (FDataLink.Field.DataSet.State = dsInsert) then
       Modified := True;
   end;
 end
 else
 begin
   FIsNull := False;
   if csDesigning in ComponentState then
     Text := Name
   else
     Text := '';
 end;
end;

obones

2006-03-31 05:33

administrator   ~0008785

A slightly enhanced version of this is ready to be put in CVS and will be as soon as it is back up at SourceForge

obones

2006-04-05 01:20

administrator   ~0008932

This is now in CVS

Issue History

Date Modified Username Field Change
2004-09-08 11:39 josz New Issue
2005-05-20 03:13 obones Note Added: 0007266
2005-05-20 03:13 obones Status new => feedback
2005-05-20 06:43 josz Note Added: 0007273
2006-03-31 05:33 obones Note Added: 0008785
2006-03-31 05:33 obones Status feedback => confirmed
2006-04-05 01:20 obones Status confirmed => resolved
2006-04-05 01:20 obones Resolution open => fixed
2006-04-05 01:20 obones Assigned To => obones
2006-04-05 01:20 obones Note Added: 0008932