Title is pretty self-explanatory. I\'ve got a DataGrid for a Windows Form Application, and I want to be able to store the values of a selected row. What is the easiest way
You could just use
DataGridView1.CurrentRow.Cells["ColumnName"].Value
Assuming i understand your question.
You can get the selected row using the DataGridView.SelectedRows
Collection. If your DataGridView allows only one selected, have a look at my sample.
DataGridView.SelectedRows Gets the collection of rows selected by the user.
if (dataGridView1.SelectedRows.Count != 0)
{
DataGridViewRow row = this.dataGridView1.SelectedRows[0];
row.Cells["ColumnName"].Value
}