私が作成した DataGrid に連結された文字列を表示する目的で関数を作成します。
file1.exe、file2.docx、file3.mp3
そのように表示するには?試してみましたが、メッセージボックスに空の文字列が表示されます。
これはコードです:
public void View()
{
string namaFile = string.Empty;
foreach (DataGridViewRow row in DGVDekripsi.Rows)
{
string NameFile = (string)row.Cells[0].Value;
namaFile += NameFile + ",";
}
MessageBox.Show(namaFile);
}