I have a strange error with a DataGridView. I attached dummy code to show it. As you can see, when you click the 1st button, it loads the DGV manually with dummy data and the DGV row formatting code is applied as expected.
But when you click the 2nd button to load the DGV via a query, the DGV row formatting code does NOT apply as expected. (You can click the "Redo" format button to make it work, but I need it to work when the form loads.)
Any idea why the formatting won't take place with the 2nd method?
(BTW, the second method via the query doesn't remain bound to the DB, does it? I don't want it to, and I assume it doesn't since the DataAdapter is destroyed, but I want to know for sure.)
Thanks.
But when you click the 2nd button to load the DGV via a query, the DGV row formatting code does NOT apply as expected. (You can click the "Redo" format button to make it work, but I need it to work when the form loads.)
Any idea why the formatting won't take place with the 2nd method?
(BTW, the second method via the query doesn't remain bound to the DB, does it? I don't want it to, and I assume it doesn't since the DataAdapter is destroyed, but I want to know for sure.)
Thanks.
Attachments
Last edited: