"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years.I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing.I would like to refactor so that I can create unit tests to be able to test the logic that effects changing the back color of cells, and updating other cells.
You can independently test the Real IPart Repository to make sure it is pulling data correctly.
I'd start with defining a simple class defining the data structure itself, and add logic to it as necessary.
Eventually, this is where your validation logic will lie. There's a great example of binding a list to a datatable and datagridview on dotnetpearls.
The very first thing you need to do is make sure that your form is not responsible for retrieving the Data Table. The Presenter should be responsible for providing it to the View.
Most likely, it will delegate this responsibility to another class, but ultimately, the Presenter will pass the information from that class to the view. Right now, there's no concept of a in this code, but there's obviously a business object that is very much a Part and your form displays a list of Parts.