2.2.4.22.16 Grid::GetOwner

Description

Get the origin object that this grid attached to

Syntax

void GetOwner( OriginObject & oo )

Parameters

oo
[Input] origin Object

Return

Examples

EX1

//Get the attached worksheet name.
void Grid_GetOwner_ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        Grid     gg;
        gg.Attach(wks);    
        
        Worksheet wksSrc;
        gg.GetOwner(wksSrc);
        out_str(wksSrc.GetName());
    }
}

EX2

//Get the attached worksheet name.
void Grid_GetOwner_ex2()
{
    Worksheet wks = Project.ActiveLayer();
    if( wks && wks.GetSystemParam(0) & WP_SHEET_HIERARCHY )
    {
        Grid     gg;
        gg.Attach(wks);    
        
        Worksheet wksSrc;
        gg.GetOwner(wksSrc);
        out_str(wksSrc.GetName());
    }
}

Remark

See Also

Header to Include

origin.h