SetSelection will be used to do multiple selection on a given Grid
BOOL SetSelection( vector<int> & vR1, vector<int> & vC1 = NULL, vector<int> & vR2 = NULL, vector<int> & vC2 = NULL, BOOL bData = true )
True for success; otherwise false.
EX1
// example select all rows in a worksheet where // col(1) is between 0.2 and 0.6 // To test, fill col(1) with uniform random numbers //col(1)=uniform(1000) void Grid_SetSelection_ex1(string strPre = "range a=1", string strCond = "a>=0.2 && a<=0.6") { Worksheet wks("Book1"); vector<uint> vnRowIndices; int nn = wks.SelectRows(strCond, vnRowIndices, 0, -1, -1, strPre); if(nn == 0) out_str("no matching row"); else { Grid gg; if(gg.Attach(wks)) { vector<int> vnRows; vnRows = vnRowIndices; gg.SetSelection(vnRows); out_int("Number of rows =", nn); } } }
SetSelection will be used to do multiple selection on a given Grid. The optional args maybe skipped under the following three situations
SetSelection(vR1); // Full rows selected;
SetSelection(vR1, vC1);// individual cells selected
SetSelection(vR1, vC1, vR2, vC2);// partial cols selected;
Worksheet::SelectRows, Grid::GetSelection
origin.h