ExpandButton, display field value of first detail record

102 views
Skip to first unread message

Daniel Raith

unread,
Mar 14, 2014, 11:52:59 AM3/14/14
to woll2woll...@googlegroups.com
I'm using delphi 7, infopower studio 2007.

I have a master detail table (customers/orders), in the customers grid I want to add a new column using the TwwExpandButton which would show a grid of the orders.

I can get this to work just fine, but I would like the column instead of being just a "+", I would like it to be wider and show a field value from the first detail record as well as the "+".

Is this possible? 

Roy Woll

unread,
Mar 14, 2014, 2:02:24 PM3/14/14
to woll2woll...@googlegroups.com
Did you try setting the expandbutton's showtext property to true? It should then show whats in the field.

-Roy

Daniel Raith

unread,
Mar 14, 2014, 3:45:38 PM3/14/14
to woll2woll...@googlegroups.com
Yes I did try setting ShowText to true.  When that didn't work I thought maybe I need to set the datasource and datafield properties as well to indicate which field to display but neither worked for me.

Roy Woll

unread,
Mar 14, 2014, 9:36:24 PM3/14/14
to woll2woll...@googlegroups.com
Our gridexpand demo does this and I see the text.  If this is a calculated field, you would need to assign it in your OnCalcFields event. Have you done this?

-Roy

Daniel Raith

unread,
Mar 17, 2014, 9:35:43 AM3/17/14
to woll2woll...@googlegroups.com
Yes it's a calculated field and I'm assigning it a value.  My expandbutton is assigned to a grid and not a datainspector.  Also my nested grid is connected to a second detail dataset which is mastersourced to the main grids dataset.  When I expand the expandbutton I can see values in the nested grid.

Daniel Raith

unread,
Mar 17, 2014, 10:05:23 AM3/17/14
to woll2woll...@googlegroups.com
I created a new delphi project using TTables and your demo .DB's, hoping to show how it's not working.  However it works in that project.  I must be missing something in my project which uses TClientDataSets accessing a Firebird database.

Daniel Raith

unread,
Mar 17, 2014, 10:40:03 AM3/17/14
to woll2woll...@googlegroups.com
I re-created the project using paradox versions of my tables and it doesn't work correctly.  I'm thinking it must be because the tables are not normalized and the detail table is mastersourced via compound masterfields (REF1;REF2).

Going to keep play around with it.

Roy Woll

unread,
Mar 17, 2014, 12:53:38 PM3/17/14
to woll2woll...@googlegroups.com
What happens if you remove the expandbutton as a custom control of the column? Does the text appear then?  If not, then the problem lies in your calculated field not getting updated properly in your OnCalcFields event.

-Roy

Daniel Raith

unread,
Mar 17, 2014, 3:30:35 PM3/17/14
to woll2woll...@googlegroups.com
Yea, I removed the expand button and the text appears, but not correctly.  I posted a question about it in the embarcadero forums.


I'm guessing it's because my tables have compound primary keys.

Reply all
Reply to author
Forward
0 new messages