Difference between revisions of "TDBGridControler"
From Free Pascal wiki
Jump to navigationJump to searchLine 62: | Line 62: | ||
Localization example, french translation of some of the component string resources | Localization example, french translation of some of the component string resources | ||
− | <syntaxhighlight lang="pascal" | + | <syntaxhighlight lang="pascal"> |
Procedure TForm1.dxDBGridControler1Localize(Sender: TObject; Component: TComponent; ID_Ressource: String; Var Translation: String); | Procedure TForm1.dxDBGridControler1Localize(Sender: TObject; Component: TComponent; ID_Ressource: String; Var Translation: String); | ||
Begin | Begin |
Revision as of 21:04, 28 December 2022
TDBGridControler is a non visual component with no dependencies providing added functionalities for the TDBGrid object
Package download link : https://gitlab.com/lazaruscomponent/dbgridcontroler
You need more functionalities? A grid controller that provide extra features to your existing TDBGrid
- Searching expression in the grid;
- Searching expression in column;
- Column filter editor;
- Datetime editor, memo editor and lookup editor;
- Saving the current filter view;
- Multi column sorting;
- Column chooser editor;
- Column grouping visual separator on one level;
- Footer and aggregation on columns;
TDBGrid Overidden Events to achive the task
- OnCellDraw
- OnCellHint
- OnEditorEdit
- OnMouseClick
- OnTitleClick
- OnTitleDraw
OnAfterFilterGrid | After filter execution |
OnAfterSortColumn | After a column is sorted |
OnAggregation | Define which column is showing an aggregation |
OnBeforeSortColumn | Before a column is sorted |
OnLocalize | Use to translate string resources |
OnPrepareLookupDataset | Use to prepare the lookup dataset |
OnSortColumn | Custom sort event, could be use to change order by statement in the SQL query |
Localization example, french translation of some of the component string resources
Procedure TForm1.dxDBGridControler1Localize(Sender: TObject; Component: TComponent; ID_Ressource: String; Var Translation: String);
Begin
If ID_Ressource = msg_search Then
Translation := 'Recherche...'
Else If ID_Ressource = msg_first Then
Translation := 'Aller au début'
Else If ID_Ressource = msg_prior Then
Translation := 'Précédent'
Else If ID_Ressource = msg_next Then
Translation := 'Suivant'
Else If ID_Ressource = msg_last Then
Translation := 'Aller à la fin'
Else If ID_Ressource = msg_add Then
Translation := 'Ajouter'
Else If ID_Ressource = msg_delete Then
Translation := 'Détruire'
Else If ID_Ressource = msg_edit Then
Translation := 'Éditer'
Else If ID_Ressource = msg_save Then
Translation := 'Enregistrer'
Else If ID_Ressource = msg_cancel Then
Translation := 'Annuler'
Else If ID_Ressource = msg_refresh Then
Translation := 'Actualiser'
Else If ID_Ressource = msg_btncancel Then
Translation := 'Annuler'
Else If ID_Ressource = msg_of Then
Translation := 'de'
Else If ID_Ressource = msg_nodata Then
Translation := 'Aucune donnée trouvée!';
End;
Screen shots