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

What is being typed into the DBGrid?
What is being typed into the DBGrid?

By , About.com Guide

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

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  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.