FlexSheet - Problem with paste when columns are sorted

Posted by: holly.anderson on 12 January 2018, 6:43 am EST

    • Post Options:
    • Link

    Posted 12 January 2018, 6:43 am EST

    Hello,

    I’m having a problem with the pasted event when columns are sorted in a FlexSheet. I have a scenario where I need to access all of the rows/items that have been added to the FlexSheet after the paste operation completes. Normally, this isn’t a problem because I can use e.row in the pasted event to get the row index and then find the corresponding item in sheet.itemsSource.items.

    I’m having a problem with this approach when columns are sorted in the FlexSheet. If multiple new rows are pasted, then the items in sheet.itemsSource.items have already been rearranged according to the sort order, but e.row still references the row where the data was originally pasted. So I don’t have a reliable way to tell which items within sheet.itemsSource.items are the new items. Interestingly, if a single new row is pasted, then the items in sheet.itemsSource.items have not yet been resorted when the pasted event fires.

    It seems like when multiple rows are pasted, the sort order is reapplied before the pasted event fires. But when only one row is pasted, the sort orders are not reapplied until after focus leaves the pasted row. I’ve attached a sample for reference. Any suggestions on how to handle this would be appreciated.

    Holly

    FlexSheetDemo_Paste_Sort.zip

  • Posted 14 January 2018, 11:51 pm EST

    Hi,

    We are looking into this.

    ~Manish

  • Posted 15 January 2018, 3:04 pm EST

    Hi Holly,

    The sorting gets done as the item gets pasted to the FlexSheet one by one. For single item pasting, the row remains in edit mode and the sorting do not apply.

    You may get the item using row index into pastedCell event.

    ~Manish

  • Posted 18 January 2018, 11:45 pm EST

    Hi Manish,

    Thanks for the explanation. This solution doesn’t work very well in my scenario, but I found another workaround that I’ve been able to use.

    Holly

Need extra support?

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

Learn More

Forum Channels