How to get a specified row focused(selected)?

Posted by: goodssh on 8 September 2017, 3:05 pm EST

  • Posted 8 September 2017, 3:05 pm EST

    Hi. 

    It's been a long time and now I have a small issue. 

    I'd like to make a specified row focused, which looks like you clicked that row and the row is obviously selected by the click event.

     

    I found SetActiveCell() but it doesn't seem to work when I do as follows. 

    MySpread.ActiveSheet.SetActiveCell(MyDictionary["SpecialID"], 0); // MyDictionary's indexer returns a integer value between 0 ~ 250000.
    MySpread.ShowRow(0, MyDictionary["SpecialID"], FarPoint.Win.Spread.VerticalPosition.Top);

    The row I wanted to get affected is shown by ShowRow().
    However, it is not "selected" yet because SetActiveCell() somewhat doesn't work.

    It would be truly appreciated if you can help me figure out what I'm missing.

    Thanks in advance. 

  • Replied 8 September 2017, 3:05 pm EST

    Hello,

    You would need to add the specific row to the selected rows collections to show it as a selected row. You can accomplish the same using the AddSelection method. Please have a look at the attached sample that depicts the same.

    Hope it helps. Please let me know if I missed something.

    Thanks,

    Manpreet Kaur


    2013/03/SelectRow.zip
  • Replied 8 September 2017, 3:05 pm EST

    This works perfectly for me. 

     

    Thank you so much. 

Need extra support?

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

Learn More

Forum Channels