Hello. There is such a question. I create a Word document in C # 'e. In the document, the table, and the table is filled from the dataGridView so

for (int i = 0; i < dataGridView1.RowCount; i++) for (int j = 0; j < dataGridView1.ColumnCount; j++) wordTable.Cell(i, j).Range.Text = dataGridView1.Rows[i].Cells[j].Value.ToString(); 

The problem is that in the Word, the last columns are not filled, and when I put a break point, everything is filled. Tell me, what's the problem?

  • @Hmayak; To format the code, select it with the mouse and click on the editor button 101010. - Nicolas Chabanovsky
  • google.ru there you will find the answer - ivan milyutkin


0