Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 20:30

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 26 Mar 2019, 17:43 
Offline

Joined: 24 Sep 2013, 12:18
Posts: 21
Hi,

I would like to check the text of a column's cell while it is been typed.
Is it possible with DBGridEh?

Is it possible to setup a column to accept only float numbers or integer numbers?

Thanks for any help.


Top
 Profile  
 
PostPosted: 09 Apr 2019, 12:01 
Offline

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

You can use DBGridEh.OnKeyPress event and check DBGridEh1.EditorMode to understand that grid in the cell editor mode.
Here is an example of event handler

Code:
procedure TForm1.DBGridEh1KeyPress(Sender: TObject; var Key: Char);
begin
  if (DBGridEh1.EditorMode) and
     (DBGridEh1.SelectedField.FieldName = 'Continent') then
  begin
    if not (CharInSetEh(Key, ['0'..'9'])) then
      Key := #0;
  end;
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: No registered users and 12 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