Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 16:04

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 27 Nov 2013, 10:10 
Offline

Joined: 26 Nov 2013, 16:15
Posts: 12
Hi,
New user to EhLib and a very ad-hoc/rusty Delphi programmer!

I've got a DBGridEh displaying data from a MemTableEh, which is populated via a dynamic ADO SQL query. That is all working fine, but I now want to use the RowDetailPanel.

When someone clicks the '+' to display the RowDetailPanel, how do I get the field data from the row they pressed the '+' against? I need some of the relevant fields to build a query to populate the RowDetailPanel.

eg

| Item_No | Description |
-----------------------
| + 1345 | Book |
| + 4356 | Chair |
| + 5646 | Table |
-----------------------

So when someone clicks the '+' against say Item 4356, I need to 'get' the Item_No, to use in a subsequent query.

I've been trying all sorts of options, but just cannot figure it out. Hopefully, someone can enlighten me!

Thanks
Clive


Top
 Profile  
 
PostPosted: 28 Nov 2013, 12:23 
Offline

Joined: 23 Aug 2013, 12:16
Posts: 16
for example:

Code:
procedure TaForm.yourGridRowDetailPanelShow ( Sender: TCustomDBGridEh; var CanShow: Boolean );
begin
  yourDetailQuery.Close;
  yourDetailQuery.ParamByName ( 'Item_No' ).AsInteger := yourMasterData.FieldByName ( 'Item_No' ).AsInteger; // yourMasterData is your MemTableEh 
  yourDetailQuery.Open;
end;




hope it helps..


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 67 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