Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

What is being typed into the DBGrid?

What is being typed into the DBGrid?

By Zarko Gajic, About.com

You can see what is being typed into a TDBGrid by looking at the TInPlaceEdit control of the TDBGrid. The following code, in the KeyUp event of the Grid will show the data in the column of the grid that is being edited:

~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.DBGrid1KeyUp(Sender: TObject;
       var Key: Word; Shift: TShiftState) ;
var
   ctrl : word;
begin
  for B := 0 to -1 + DBGrid1.ControlCount do
    if DBGrid1.Controls[ctrl] is TInPlaceEdit then
      with DBGrid1.Controls[ctrl] as TInPlaceEdit do
        Caption := 'Typing in Grid: ' + Text;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to find what control was previously selected
« How to search and replace in RichEdit

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2003 Delphi Tips
  7. What is being typed into the DBGrid?

©2009 About.com, a part of The New York Times Company.

All rights reserved.