Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 14:00

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: column Chekboxes
PostPosted: 03 Sep 2021, 12:51 
Offline

Joined: 10 Aug 2021, 23:30
Posts: 8
I added a bollean column to dbgrideh and marked the column property as checkboxes, however when I click the record is in editing.... what is the correct way for it to apply a post?


Attachments:
Sem título.png
Sem título.png [ 50.07 KiB | Viewed 660 times ]
Top
 Profile  
 
 Post subject: Re: column Chekboxes
PostPosted: 03 Sep 2021, 14:20 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

You need to write a handler for the TColumnEh.OnUpdateData event
for a column with a checkbox,
write the value to the field yourself, and perform the Post operation for the DataSet.

An event handler might look like this:

Code:
procedure TForm1.DBGridEh1Columns5UpdateData(Sender: TObject; var Text: string;
  var Value: Variant; var UseText, Handled: Boolean);
var
  Column: TColumnEh;
begin
  Column := Sender as TColumnEh;
  Column.Field.Value := Value;
  Column.Field.DataSet.Post;
  Handled := True;
end;

_________________
Best regards
EhLib Support Team


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 53 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:  
Powered by phpBB® Forum Software © phpBB Group