I have a DataGridView which displays a object I've derived from DataSet. In my object, I have an ArrayList if items, I've used to create DataRows in a DataTable, which is then displayed by the DataGridView. I have also derived a class from DataGridViewTextBoxCell, to handle drawing my cells.
Here's the problem. The background color of a row, depends on a property of the an item in my original ArrayList of items. Before sorting the rowIndex I get in the DataGridViewTextBoxCell Paint corresponds to the index into my ArrayList of items. After the user sorts the table, it does not. How do I map between these? What is the easiest way?