2011年7月3日 星期日

[C#] 點選DataGridView欄位取得欄位值

private void DataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
{
    //取得欄位值
    string value = DataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex + 1].Value.ToString();
}

沒有留言:

張貼留言