0
두 개의 열 (id
및 Description
)이있는 DataGridView 테이블이 있습니다. 사용자가 설명 열에있는 셀을 선택하면 왼쪽의 셀 옆에 id
값을 가져올 수 있기를 원합니다.DataGridViewCell 선택한 셀 옆에 셀 값 가져 오기
dataGridView1.CellClick += (s, e) =>
{
int id;
DataGridViewCell cell = dataGridView1.SelectedCells[0];
//Instead of this, what do I put to get the ID column?
if (cell.ColumnIndex == 0)
id = Convert.ToInt32(cell.Value);
else
return;
string[] data = UnitData[id];
txtNum.Text = id.ToString();
txtName.Text = data[0];
txtDesc.Text = data[1];
};
내가 선택한 열이있는 경우, 옆에있는 셀을 얻을 설명 있는지 확인 할 수 있도록하려면 다음은
는 내가 지금까지 가지고있는 것입니다.어떻게하면됩니까?
훌륭합니다. 감사! – ben
welcome ....': D' – spajce