I want to count certain rows of my datagridview, at the moment I only know that dgt.RowCount
the total number of rows in the datagridview counts, in my case I want to count rows that meet a condition. the rows have a section called "Average" in it there are integer values, I want to count only the rows in which the average section is >=70 and then take that value to a label.
You can use Linq
The cast a
DataGridViewRow
is necessary to be able to do Linq queries, since the classDataGridViewRowCollection
does not expose the interfaceIEnumerable<DataGridViewRow>
.I have been looking for some information Here , Here and Here and I think you should make a loop similar to this which I will write to you in pseudocode:
I hope it has served you, remember that it is pseudocode and you must adapt it to your needs. Follow the links.