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