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?
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?
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
}