Adding rows to second column ONLY - populating data using a for loop

前端 未结 1 1366
夕颜
夕颜 2020-12-21 23:59

I calculate the amount of rows I want to have in my second column using a for loop based on reading how many records a file has that has been opened. I have

相关标签:
1条回答
  • 2020-12-22 00:38

    If you want to omit the value for the first column, just add null or DBNull.Value, e.g.:

    DataGridView1.Rows.Add(DBNull.Value, Count++);
    

    This way, the first column will be empty while the second columns contains the value of Count.

    0 讨论(0)
提交回复
热议问题