Posted 11 November 2017, 2:01 am EST
Hi,
I have a difficulty while taking the index of multiple rows selected in ActiveSheet.
Control and select multiple rows works. But shift and select multiple rows shows only a single row.
Forums Home / Spread / Spread for WinForms
Posted by: priyankaajgowda16 on 11 November 2017, 2:01 am EST
Posted 11 November 2017, 2:01 am EST
Hi,
I have a difficulty while taking the index of multiple rows selected in ActiveSheet.
Control and select multiple rows works. But shift and select multiple rows shows only a single row.
Posted 13 November 2017, 10:53 am EST
Hello,
I used the following code to access the selected rows, cells and it works absolutely fine:
fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange;
fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell;
private void button1_Click(object sender, EventArgs e)
{
FarPoint.Win.Spread.Model.CellRange[] cr;
cr = fpSpread1.ActiveSheet.GetSelections();
label1.Text = "The selection covers cells " + cr[0].Row + ", " + cr[0].Column + ", " + cr[0].RowCount + ", " + cr[0].ColumnCount;
}
Please make sure that you have set the selection unit for Spread. It can be Cell, Row or Column.
Thanks,
Deepak Sharma