Not able to remove selection from row

Posted by: nitish.bose on 1 October 2018, 6:56 am EST

    • Post Options:
    • Link

    Posted 1 October 2018, 6:56 am EST

    Hi,

    I have some rows in my spread where I have set selection on row using ActiveRowIndex and AddSelection(). using this row is getting selected.

    Later based on some condition I want to remove selection from that row so I have used

    sprdProduct.ActiveSheet.ActiveRowIndex = -1;

    sprdProduct.ActiveSheet.ClearSelection();

    but first row is getting selected instead of removing selection.

    I dont want to select any row.

    Please advise.

  • Posted 1 October 2018, 9:38 am EST

    ++

    Not able to set -1 to ActiveRowIndex

  • Posted 3 October 2018, 2:47 am EST

    still waiting for response.

  • Posted 4 October 2018, 9:31 am EST

    Hello,

    You would need to use RemoveSelection to get rid of the selection on sheet. For example:

    fpSpread1.ActiveSheet.RemoveSelection(2, 0, 2, 2);

    You can use RemoveSelection() method with GetSelection() after getting selection you can remove the selection.

    Thanks,

    Deepak Sharma

  • Posted 5 October 2018, 5:14 am EST

    Hi Deepak,

    I am able to remove selection but the problem is I am not able to set ActiveRowIndex to -1.

    I am using following line of code to make set it as -1

    sprdProduct.ActiveSheet.ActiveRowIndex = -1;

    but it is getting set as 0 always

  • Posted 8 October 2018, 9:49 am EST

    Hello Nitish,

    It does not allow setting the ActiveRowIndex to -1, the only to remove selection is by calling remove selection. By default it always have one cell selected.

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels