ma ouml

ma ouml

  • NA
  • 436
  • 88.9k

How to select a line by retrieving a datagridview column

Jun 18 2017 5:14 PM
HI FRIENDS
I want that when I select a line after I click on the link I display the state and the line select I retrieve the first column
I tested this and it was much more now it does not work
I do not know why
private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
{
//row is selected
if (dataGridView1.SelectedRows.Count == 1)
{
//link label click
if (dataGridView1.Columns[e.ColumnIndex] is DataGridViewLinkColumn && (e.RowIndex >= 0))
{
num_att = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
etat_att_marche etm = new etat_att_marche(textBox1.Text, num_att);
etm.Show();
//MessageBox.Show(num_att);
}
}
}
 
 
 
 
It shows this error
 
 

Answers (2)