我怎么能给datagridview列值

时间:2018-03-12 12:29:41

标签: c#

Datagrid 当containsno列具有相同的值时,我想给datagridview invoiceno列赋予相同的值。

  for (int i = 0; i < dgvDetails.Rows.Count; i++)
            {
                if (i == 0)
                {
                    dgvDetails.Rows[i].Cells[12].Value = invNo;
                    dgvDetails.Rows[i].Cells[15].Value = DAL.ShippingInvoicesSold_dal.ShippingInvoiceName(invNo);
                }
                else
                {
                    invNo = invNo + 1;
                    dgvDetails.Rows[i].Cells[12].Value = invNo;
                    dgvDetails.Rows[i].Cells[15].Value = DAL.ShippingInvoicesSold_dal.ShippingInvoiceName(invNo);

                }
            }

0 个答案:

没有答案