THat code doesn't display any information in any cells - it pulls information from all rows, and mashes it together into a single string. What you do with that afterwards we have no idea.
But ... trhe problem may be related to your poor indentation:
for (int j = 0; j < dGV.Rows[i].Cells.Count; j++)
stLine = stLine.ToString() + Convert.ToString(dGV.Rows[i].Cells[j].Value) + "\t";
stLine = stLine.ToString() + Convert.ToString(dGV.Rows[i].Cells[1].Value) + "\t" + test;
stOutput += stLine + "\r\n";
The inner loop body consists of only the first of those instructions:
stLine = stLine.ToString() + Convert.ToString(dGV.Rows[i].Cells[j].Value) + "\t";
The opther two are part of the body of the outer loop:
for (int i = 0; i < dGV.RowCount - 1; i++)
{
string stLine = "";
...inner loop ...
stLine = stLine.ToString() + Convert.ToString(dGV.Rows[i].Cells[1].Value) + "\t" + test;
stOutput += stLine + "\r\n";
}
If you indent it correctly, it's a lot more obvious:
string test = "2023-24/k-";
string insertValueAs = "\t" + test;
for (int i = 0; i < dGV.RowCount - 1; i++)
{
string stLine = "";
for (int j = 0; j < dGV.Rows[i].Cells.Count; j++)
stLine = stLine.ToString() + Convert.ToString(dGV.Rows[i].Cells[j].Value) + "\t";
stLine = stLine.ToString() + Convert.ToString(dGV.Rows[i].Cells[1].Value) + "\t" + test;
stOutput += stLine + "\r\n";
}
But since it's not at all clear what you expect to acheive, we can't fix it for you!