Add one line of code after creating each row to remove last comma(,) as follows:
StreamWriter streamWriter = new StreamWriter("" + TxtDestnation.Text + "");
string strHeader = "";
for (int i = 0; i < dataGridView1.Columns.Count; i++)
{
strHeader += dataGridView1.Columns[i].HeaderText + ",";
}
streamWriter.WriteLine(strHeader);
for (int m = 0; m < dataGridView1.Rows.Count; m++)
{
string strRowValue = "";
for (int n = 0; n < dataGridView1.Columns.Count; n++)
{
strRowValue += dataGridView1.Rows[m].Cells[n].Value + ",";
}
strRowValue = strRowValue.Substring(0, strRowValue.Length - 1);
streamWriter.WriteLine(strRowValue);
}