How to get Selected Block in FarPoint v5.0

Posted by: banshpatel on 8 September 2017, 3:12 pm EST

  • Posted 8 September 2017, 3:12 pm EST

    Hi,

    How to get selected block in farpoint sheet? While working with FarPoint spread, I am able to get "IsBlockSelected == True" but not able to get exact selected block. I need to iterated over selected block with for loop in c# 2010.

    Please help me out with some code snippet.

    Thanks,
    Bansh
  • Replied 8 September 2017, 3:12 pm EST

    Thanks for viewing post. Above proble is resolved. Please click over http://sphelp.grapecity.com/groups/topic/getselection-fails-when-for-whole-sheet/ for the detailed solution
  • Replied 8 September 2017, 3:12 pm EST

    That resolves the problem when the whole sheet is selected but not if only a couple of rows is selected.
    Anyone that have a solution on that?
  • Marked as Answer

    Replied 8 September 2017, 3:12 pm EST

    Hi,

    Try the GetSelections method.


    DialogResult dlg;
    fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange;
    fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2);
    fpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2);
    dlg = MessageBox.Show("Do you want to get one of the selections?", "GetSelection", MessageBoxButtons.YesNo);
    if (dlg == DialogResult.Yes)
    {
    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;
    }


    - Gina
  • Replied 8 September 2017, 3:12 pm EST

    Hello,

    We hope that your issue is resolved.

    Thanks,
    Reeva
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels