Cannot not get the row index by IndexOf after the DataTable was Select and Sort

@opas1216
there could be few options that can be checked:

  • in one scenario we marked the SourceDataTable with an additional rowIndex Column, did all the actions on a copyDataTable and when forwarding the date filtered data we just removed the rowIndex Column.

If you are interested on how to add the rowIndex let me know.

Another approach could be: lets assume a row in CopyDataTable was identified (called drCFound)
SequenceEquals via the itemArrays can be checked for the index

SourceDataTable.asEnumerable.toList.FindIndex(function ( r ) r.ItemArray.SequenceEqual(drCFound.ItemArray))

More Info here:

Let us know if you need further help

1 Like