| TDBAdvGrid - how to print a memo field content |
|
Set grid.WordWrap = true and call grid.AutoSizeRows() ?
For printing, also set grid.PrintSettings.NoAutoSize = true
otherwise column sizes are auto adapted to the width of text in a cell.
| TDBAdvGrid - how to select multiple entries |
|
Do this by adding the code:
for i := 1 to DBAdvGrid1.RowCount - 1 do
begin
dbadvgrid1.Cells[1,i] := dbadvgrid1.Columns[1].CheckTrue;
end;
in the OnFormCreate event of the demo ADOSelection.
| TDBAdvGrid - how to use row move |
|
If you want to use the row moving option,
set grid.PageMode = false
| TDBAdvGrid.SaveToDOC results in an olesyserror |
|
This is normal when run from the IDE that has a setting to catch all exceptions.
This is a properly handled exception that will not see when run outside the IDE
or when disable catching all exceptions in the IDE itself.
| TDBAdvGrid.SaveToHTML first character arrow left (<<) not shown |
|
To enable showing the first character being an arrow left (<<) of a field do
Set grid.EnableHTML = false
| TDBAdvGrid - how to use row move |
|
To use the row moving option: set grid.PageMode = false
| TAdvStringGrid - how to remove rows |
|
Example deleting rows from a advstringgrid with a condition.
procedure TfrmTDBViewer.mmEditRemoveIndexRowsClick(Sender: TObject);
Var i : Integer;
begin
AdvStringGridFieldList.MouseActions.DisjunctRowSelect := true;
AdvStringGridFieldList.Options := AdvStringGridFieldList.Options + [goRowSelect];
For i := 1 To AdvStringGridFieldList.RowCount - 1 Do Begin
If LowerCase(AdvStringGridFieldList.AllCells[0, i]) = 'index' Then Begin
AdvStringGridFieldList.RowSelect[i] := True;
End;
End;
AdvStringGridFieldList.RemoveSelectedRows;
AdvStringGridFieldList.Options := AdvStringGridFieldList.Options - [goRowSelect];
end;
| TDBAdvGrid.SaveToFixed - needs AdvObj |
|
To use this method, the Unit **AdvObj** needs to be included:
Uses AdvObj;
Var lstFields : TIntList;
Begin
lstFields ....
DBAdvGrid.SaveToFixed(sFile, lstFields);
| TAdvStringGrid - How to Print Columnheaders |
|
To do so set: Grid.SaveFixedCells := true
This can be used for savetohtml ... and print.
| TAdvColumnGrid - Filter |
|
Implement filtering capabilities with the AdvStringGrid can be done by
the built-in Filter property in grid.Columns[].
When used it will automatically show a filter dropdown in the column header.
| TAdvStringGrid - Two Line Column Headers |
|
This is set via grid.Cells[col,row] := 'Line1'#13#10'Line2';
| TAdvStringGrid - How to store and restore SearchFooter Edittext |
|
Save with: mysavetext := advgrid.lastsearch
Resore with: advgrid.SearchPanel.EditControl.Text := yourtext
| TAdvStringGrid - Set Hourglass Cursor while sorting |
|
In OnCanSort event set screen cursor to crHourglass
and in OnClickSort reset it to the default cursor.
|