Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 26 Apr 2024, 20:11

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 03 Mar 2020, 17:31 
Offline

Joined: 03 Mar 2020, 17:20
Posts: 2
Hallo,
I am trying to refactor a small project by replacing DevExpress cxGrid with EhLib since it seems much more easy and immediate to use.

I am facing the following issue: while the user is editing a row inside the grid, I want to prevent unwanted "post" to the database after the user clicks on a different row (post or cancel should only be allowed from a dedicated dbnavigator).

On cxGrid, I used CanSelectRecord and CanFocusRecord events to set allow := true and thus allowing scroll to other rows only when the database is not in editing mode.

How can I achieve the same results on EhLib ? Is there any equivalent event ?

Thank you ;-)


Top
 Profile  
 
PostPosted: 04 Mar 2020, 13:02 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello rikkardo

Try to use TDataSet.BeforePost event like this.

Code:
procedure TForm1.MemTableEh1BeforePost(DataSet: TDataSet);
begin
  if (ActiveControl = DBGridEh1) then
  begin
    ShowMessage('DBGridEh: Post record before move to another row.');
    Abort;
  end;
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 04 Mar 2020, 13:55 
Offline

Joined: 03 Mar 2020, 17:20
Posts: 2
It was so easy, that I didn't think about, a big Thank You !!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group