Multirowgrid with DBStringGridEd

27 views
Skip to first unread message

Ulrich Schaupp

unread,
Mar 21, 2025, 8:36:11 AMMar 21
to Rosi Delphi Components
Hi Tomas,

how can I define a Listbox in one cell in a defined row and set the selected item?

Best regards
Uli

Tomas Rosinsky

unread,
Mar 25, 2025, 2:37:55 PMMar 25
to Rosi Delphi Components
Hi Uli,

currently it can be defined just by custom code anyway I plan to implement also design time setting to next version.

Example of solution for sg4 and field Title:

event OnGetEditStyle

procedure TrDBStringGridEdTest.sg4GetEditStyle(Sender: TObject; Col,
  Row: Integer; var EditStyle: TrStringGridEdEditStyle);
var d: TrDBStringGridEdMultiRow;
begin
  d:=sg4.GetCellMultiRowDef(Col, Row);
  if Assigned(d) then
  begin
    if SameText(d.FieldName,'Title') then
      EditStyle:=sgbDropDown;
  end;
end;

event OnPicklistDropdown

procedure TrDBStringGridEdTest.sg4PicklistDropdown(Sender: TObject; Col,
  Row: Integer; var PickList: TStringList);
var d: TrDBStringGridEdMultiRow;
begin
  d:=sg4.GetCellMultiRowDef(Col, Row);
  if Assigned(d) then
  begin
    if SameText(d.FieldName,'Title') then
      PickList.Assign(MyList);
  end;
end;

I hope it helps.
Best regards
Tomas

Dne pátek 21. března 2025 v 13:36:11 UTC+1 uživatel Ulrich Schaupp napsal:

Ulrich Schaupp

unread,
Mar 25, 2025, 4:26:16 PMMar 25
to Rosi Delphi Components
Hi Tomas,

thank you for reply.
It helps and I'm happy ;)

Best regards
Uli
Reply all
Reply to author
Forward
0 new messages