Master and Detailed Grids

PlatinumGrid - Full version
Post Reply
garymwilson67
Posts: 19
Joined: Fri Apr 01, 2016 3:15 pm

Master and Detailed Grids

Post by garymwilson67 » Thu Jan 05, 2017 6:58 pm

Hi Jon,

Sorry to ask yet another question. I have a grid which contains a master grid and a detail grid. It works great BUT there is detail available only for some of the rows in the master grid. My question is whether it is possible to show the expansion icon (a '+' inside a small box) only for those rows where detail is available. If there is no detail, I did not want to show this symbol.

Thanks again,

Gary

jomitech
Site Admin
Posts: 1967
Joined: Wed Oct 08, 2008 12:23 am

Re: Master and Detailed Grids

Post by jomitech » Thu Jan 05, 2017 11:31 pm

PlatinumGrid doesn't support this out of the box. I have attached a minor change that will allow you to control the visibility of that plus sign by using the OnRowData method. For example:

Code: Select all

$masterGrid->OnRowData = 'gridOnRowData';

function gridOnRowData( $sender, $params )
{
    $fields = &$params[ 1 ];
    $showExpand = &$params[ 2 ];

    if( !$fields[ "HasChildren" ] )
    {
        $showExpand = false;
    }
}
Attachments
masterdetail.zip
(35.49 KiB) Downloaded 221 times
Jon

garymwilson67
Posts: 19
Joined: Fri Apr 01, 2016 3:15 pm

Re: Master and Detailed Grids

Post by garymwilson67 » Sat Jan 14, 2017 12:36 pm

Thanks for the fix.

I am currently using V12 so I assume the file you supplied is compatible? It seems to be so far but I have not tested exhaustively after moving from V11.

Regards

Gary

P.S. In what version did the summary feature appear for totalling up column values, etc?

jomitech
Site Admin
Posts: 1967
Joined: Wed Oct 08, 2008 12:23 am

Re: Master and Detailed Grids

Post by jomitech » Sat Jan 14, 2017 12:47 pm

Yes it is compatible. The file I supplied is version 13, but there were just bug fixes between 11 and 13.

The summary feature was implemented in Update 5, if I recall correctly.
Jon

Post Reply