blah blah blah is here! blah blah » Close

up2down
link

I'm trying to count the rows on my datagridview and display the number of rows on "label1" what's the best way to do this? i was going to drop the code in the form load event.

Also i only want to count rows with text in, as datagridviews always leave a blank row at the bottom.

last answered one year ago

1 answers

link

This line should do it:

label1.Text = (dataGridView1.Rows.Count - 1).ToString();

Nice one vulpes - Thanks

Feedback