private void dataGridViewSubLocation_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
//string id = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[0].Value.ToString();
id = Convert.ToInt32(dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[0].Value);
masterLocComboBox.Text = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[1].Value.ToString();
txtLocName.Text = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[2].Value.ToString();
txtLocAddress.Text = dataGridViewSubLocation.SelectedRows[e.RowIndex].Cells[3].Value.ToString();
}
........... here i;m using row index but still giving error.