Looping each row in datagridview

后端 未结 2 1807
温柔的废话
温柔的废话 2020-12-06 04:52

How to loop each row that readed? in my code, the row won\'t bind to next row because of the same productID, so the datagridview won\'t move to new row, it still in the same

2条回答
  •  被撕碎了的回忆
    2020-12-06 05:25

    Best aproach for me was:

      private void grid_receptie_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            int X = 1;
            foreach(DataGridViewRow row in grid_receptie.Rows)
            {
                row.Cells["NR_CRT"].Value = X;
                X++;
            }
        }
    

提交回复
热议问题