troubleshooting Question

Determining sorted order, in DataGridView cell Paint method.

Avatar of gerry99
gerry99 asked on
C#
4 Comments1 Solution743 ViewsLast Modified:
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?

Thanks,
Gerry
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros