I'm using a DataGridView in a WinForm for the very first time, and have run into an odd problem.
I'm trying to populate the DataGridView control from the database. I'm not binding it to a dataset or anything, but retrieving a set of rows from a Sqlite query. I am then populating the rows programmatically from the data retrieval result. The grid is set up like this (as it appears in the designer):
What happens at runtime is fine, except for what appears to be a "phantom" row, which shows up in the grid as it appears in the designer, as the last row (blank or unpopulated), when I finish loading the grid. I've tried clearing the rows:
DataGridView.Rows.Clear();
But this doesn't clear anything. Trying to remove or make this row invisible fails with an exception because it's apparently uncommitted.
How do I get rid of the thing?