Grid::GetSelectedRange

Description

It retrieves the current selection in the notation in which the (first, if there are multiple, which is not supported yet) header row or column has index 0, followed by label rows and columns, followed by data rows and columns.

Syntax

BOOL GetSelectedRange( int & r1, int & c1, int & r2, int & c2 )

Parameters

r1
[output] Receives the index of the first rows in the selection
c1
[output] Receives the index of the first columns in the selection
r2
[output] Receives the index of the last rows in the selection
c2
[output] Receives the index of the last columns in the selection

Return

TRUE if success else FALSE.

Examples

EX1

//before running please highlight one range
void Grid_GetSelectedRange_ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        Grid gg;
        gg.Attach(wks);
        if(gg)
        {
            int r1, c1, r2, c2;
            gg.GetSelectedRange(r1, c1, r2, c2);
        }        
    }
}

Remark

See Also

Grid::GetSelection

header to Include

origin.h