View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005318 | JEDI VCL | 00 JVCL Components | public | 2010-09-01 16:38 | 2010-09-06 15:42 |
Reporter | digoni | Assigned To | jfudickar | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.39 | ||||
Target Version | Fixed in Version | ||||
Summary | 0005318: TJvFormStorage not save at runtime | ||||
Description | Hi, I have a TJvFormStorage (JvFormStorage1) on my form (fxBase), and at runtime i added StoredProps of some components. When i open the INI file, everything is fine excepts the StoredProps dont write, even, when the form is opened, the properties are not loaded. How can i add StoredProps at runtime to load and save it ?? Some piece of code: procedure TFxBase.FormCreate(Sender: TObject); begin for I := 0 to pred(ComponentCount) do begin if (Components[I] is TJvDBGrid) then begin TJvDBGrid(Components[I]).IniStorage := JvFormStorage1; TJvDBGrid(Components[I]).Columns.State := csCustomized; JvFormStorage1.StoredProps.Append(TJvDBGrid(Components[I]).Name+ '.AlternateRowColor'); JvFormStorage1.StoredProps.Append(TJvDBGrid(Components[I]).Name+ '.RowHeight'); JvFormStorage1.StoredProps.Append(TJvDBGrid(Components[I]).Name+ '.FixedCols'); end; end; end; | ||||
Additional Information | Attached an example to reproduce the problem. | ||||
Tags | No tags attached. | ||||
2010-09-01 16:38
|
Test-JvFormStorage.zip (620,160 bytes) |
|
Hi, this is a problem of your timing. Placing this code in the onCreate event didn't work, because when loading the dfm file into memory the contents of the StoredProps is resetted to the values in the dfm file. Change your code and place the definition into the overloaded procedure "Loaded". This procedure is executed after the dfm file is loaded. Please inform us when the problem is solved. Kind Regards Jens TForm1 = class(TForm) JvFormStorage1: TJvFormStorage; JvAppIniFileStorage1: TJvAppIniFileStorage; JvDBGrid1: TJvDBGrid; private { Private declarations } protected procedure Loaded; override; public { Public declarations } end; procedure TForm1.Loaded; var I : Integer; begin inherited; for I := 0 to pred(ComponentCount) do begin if (Components[I] is TJvDBGrid) then begin TJvDBGrid(Components[I]).IniStorage := JvFormStorage1; TJvDBGrid(Components[I]).Columns.State := csCustomized; JvFormStorage1.StoredProps.Append(TJvDBGrid(Components[I]).Name+ '.AlternateRowColor'); JvFormStorage1.StoredProps.Append(TJvDBGrid(Components[I]).Name+ '.RowHeight'); JvFormStorage1.StoredProps.Append(TJvDBGrid(Components[I]).Name+ '.FixedCols'); end; end; // ShowMessage(JvFormStorage1.StoredProps.Text); end; |
|
Thanks for reply, ive putted the code on TForm1.Loaded then now it works perfectly. How can i change this thred status to "done" ?? |
|
Done :-) |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-09-01 16:38 | digoni | New Issue | |
2010-09-01 16:38 | digoni | File Added: Test-JvFormStorage.zip | |
2010-09-06 01:26 | jfudickar | Note Added: 0017652 | |
2010-09-06 01:26 | jfudickar | Status | new => feedback |
2010-09-06 15:31 | digoni | Note Added: 0017654 | |
2010-09-06 15:42 | jfudickar | Note Added: 0017655 | |
2010-09-06 15:42 | jfudickar | Status | feedback => resolved |
2010-09-06 15:42 | jfudickar | Resolution | open => fixed |
2010-09-06 15:42 | jfudickar | Assigned To | => jfudickar |