메신저가 15 개 대신 3 개의 열을 목록 상자에 가져 오려고 할 때 어떻게해야합니까?특정 열을 DataBoxView에서 목록 상자로 가져 오는 방법
이것은 모든 열을 가져 오는 코드입니다.
private void testlist()
{
string[,] Datavalue = new string[dataGridView1.Rows.Count, dataGridView1.Columns.Count];
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach (DataGridViewColumn col in dataGridView1.Columns)
{
Datavalue[row.Index, col.Index] = dataGridView1.Rows[row.Index].Cells[col.Index].Value.ToString();
}
}
int i = 1;
string strval = "";
foreach (string ss in Datavalue)
{
strval += ss + " ";
if (i == 15)
{
listBox1.Items.Add(strval);
strval = "";
i = 0;
}
i++;
}
}
내가 2 세를 원하는 15 열 – Luka