Think line 8 of your first code post never gets executed.
j=19 and so is Columns.Count so the condition in youfor statement: j < dataGridView1.Columns.Count; will end the for loop.
BTW. It is a bad habit to use hardcoded numbers in your code.
But I confess, sometimes I still have bad habits too.:icon_evil:
ddanbe
Industrious Poster
4,375 posts since Oct 2008
Reputation Points: 2,126
Solved Threads: 738
Skill Endorsements: 26