Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2006, 04:01 AM
a_h_hashemi a_h_hashemi is offline
Senior Member
 
Join Date: Nov 2005
Posts: 111
Default showing the content of each cell of 'DBGrid'

Hello:

I have a database program which uses 'ADOTable' and 'DBGrid'.
I want to show the content of each cell of 'DBGrid' on a 'Edit'
as It (cell) is clicked.What should I do?


Could you please help me?

Regards,
Reply With Quote
  #2  
Old 10-18-2006, 04:14 AM
daltamira daltamira is offline
Senior Member
 
Join Date: Aug 2006
Location: Argentina
Posts: 959
Default RE: showing the content of each cell of 'DBGrid'

[delphi]
//When the is clicked, OnCellClick event is triggered
procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
edit1.Text := Table1.FieldByName(Column.FieldName).Value;
end;
[/delphi]
Reply With Quote
  #3  
Old 10-18-2006, 07:24 AM
FreddyB FreddyB is offline
Senior Member
 
Join Date: Jul 2003
Location: Bogotá - Colombia
Posts: 488
Default RE: showing the content of each cell of 'DBGrid'

Is more easy that you think... and you don{t need extra code


put some DBEDIT, not EDIT....
and Set tha same DATASOURCE property to the DBEdit that DBGRid
and specify which column you want to show, it automatically will show the respective data

Freddy Bueno
from Bogotá - COLOMBIA

8^) EtoMayTTak
Reply With Quote
  #4  
Old 10-18-2006, 07:29 AM
daltamira daltamira is offline
Senior Member
 
Join Date: Aug 2006
Location: Argentina
Posts: 959
Default RE: showing the content of each cell of 'DBGrid'

Yes I know that.... but a_h_hashemi asked for a way to fill a TEdit when the cell is clicked.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:05 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.