Tips and Frequently Asked Questions
Persisting column sizes & column order for a TDBAdvGrid
Assuming a user can resize & move columns around in a TDBAdvGrid and it is desirable that the last state is saved & restored when the application is restarted, this can be done in following way:
- Set default column order & size state after making the dataset active in the TDBAdvGrid with grid.SetColumnOrder
- When column states are found, restore these from INI file with grid.StringToColumnStates
- When the application closes, save the last state to INI file with grid.ColumnStatesToString
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); var inif: TINIFile; begin inif := TINIFile.Create('.\settings.ini'); inif.WriteString('STATES','DBADVGRID1',DBAdvGrid1.ColumnStatesToString); inif.Free; end; procedure TForm1.FormCreate(Sender: TObject); var inif: TINIFile; colstates: string; begin adotable1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\CARS.mdb;Persist Security Info=False'; adotable1.Active := true; DBAdvGrid1.SetColumnOrder; DBAdvGrid1.Options := DBAdvGrid1.Options + [goColSizing, goColMoving]; inif := TINIFile.Create('.\settings.ini'); colstates := inif.ReadString('STATES','DBADVGRID1',''); inif.Free; if colstates <> '' then DBAdvGrid1.StringToColumnStates(colstates); end;
Pricing
Single Developer License
Small Team License
Site License
TMS VCL UI Pack
€ 375
€
150
yearly renewal
license for 1 developer
MOST POPULAR
BEST VALUE
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.
Free Trial
Note that the TMS VCL UI Pack replaces the TMS Component Pack. Both products can't be installed simultaneously. Therefore TMS Component Pack must first be uninstalled before installing the TMS VCL UI Pack