How to go to the column of a datagridview c # foreach

0

I need help how to do this I need to go through a column (amount) of the datagridview when the amount reaches 0 so that it does not let me insert products that do not exist and leave me a message that there is no stock (no products) Any ideas?

    
asked by gelder gomez 13.04.2018 в 16:40
source

1 answer

-1

This code is the answer to your problem. :) you are welcome. PDTA: what this does is, as long as it has data to go through in DataGidView , when it stops having data it will stop reading it to avoid producing the error that comes out.

foreach (DataGridViewRow dtv in this.tuDataGridView.Rows){
                        //aqui pones tu codigo
}
    
answered by 13.04.2018 в 17:00