Hello Boki,
how can I calc rowheight in dbGrid to show the complete table column text or Memo in associated grid cell?
Best regards
Uli
Posted 11 August 2023 - 09:29 AM
Hello Boki,
how can I calc rowheight in dbGrid to show the complete table column text or Memo in associated grid cell?
Best regards
Uli
Posted 31 August 2023 - 09:32 PM
procedure TForm2.NextDBGrid61MeasureRowHeight(Sender: TObject; Index: Integer; var RowHeight: Integer); begin if Index = 2 then RowHeight := 40; end;Inside it we can use for example GetTextSize that I have in NxGraphics6.pas unit. Or you can use TCanvas.TextRect to measure text size.
procedure TForm2.NextDBGrid61MeasureRowHeight(Sender: TObject; Index: Integer; var RowHeight: Integer); begin RowHeight := GetTextSize(NextDBGrid61.Canvas, MyRectToFit, NxDBTextColumn61.DataBinding.Field.AsInteger).cy; end;I hope that this helps. If not I can make a small demo.
NextSuite v5 - VCL Components (Previous version) →
NextDBGrid Component →
DBGrid add/del rows with Ins/DEL keysStarted by csanesz, 21 Jan 2022 dbgrid, insert, rows, delete |
|
|||
NextSuite v6 - VCL Components →
NextGrid v6 Component →
Help with NextGrid.RowHeight at runtime.Started by lsquez, 21 Aug 2018 NextGrid, RowHeight, runtime |
|
|||
NextSuite v6 - VCL Components →
NextDBGrid v6 Component →
Right-to-Left Language SupportStarted by linuxawi, 16 Dec 2015 RTL, dbgrid |
|
0 members, 1 guests, 0 anonymous users