Jump to content


GridAcceptEdit event doesn't work as expected.

  • Please log in to reply
1 reply to this topic

#1 FourWhey

  • Members
  • 162 posts

Posted 06 August 2019 - 04:26 PM

Accept and CanLeave are in this order in the method signatures where they're declared and implemented.

TNxAcceptEditEvent = procedure (Sender: TObject; ACol, ARow: Integer; var Text: WideString; var Accept: Boolean; var CanLeave: Boolean) of object;
procedure DoAcceptEdit(ACol, ARow: Integer; var Text: WideString; var Accept: Boolean; var CanLeave: Boolean); dynamic;
procedure TNxCustomGrid6.DoAcceptEdit(ACol, ARow: Integer; var Text: WideString; var Accept, CanLeave: Boolean);
  if Assigned(FOnAcceptEdit) then FOnAcceptEdit(Self, ACol, ARow, Text, Accept, CanLeave);

However, there are a couple places where DoAcceptEdit is called and the order of Accept and CanLeave are reversed. I've fixed this in my code, but I imagine this is a bug that others might be experiencing as well.


{ Yes, Assign }
Result := True;

DoAcceptEdit( FEditingCell.X, -1, Text, FCanLeaveEdit, Result ); // NxCustomGrid6.pas (645)
DoAcceptEdit( FEditingCell.X, FEditingCell.Y, Text, FCanLeaveEdit, Result ); // NxCustomGrid6.pas (673)



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,900 posts
  • Gender:Male

Posted 06 August 2019 - 04:32 PM

Thanks, I will check this and fix.

boki@bergsoft.net | LinkedIn Profile
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
BergSoft Facebook page
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users