Developer
Developer

Reputation: 8636

Is it possible to select both treeview node and the row of a datagridview

Actually i will have a form open when i click on a row of datagridview . When i make necessary changes and click on save i would like the select that particular row as selected which i previously i selected as well as i had to make one of the tree node to be get selected too..

alt text

If i click on the 2nd row i will have a form open if i click on save i would like to select that row again

alt text

Upvotes: 0

Views: 1484

Answers (1)

Developer
Developer

Reputation: 8636

Got the answer

  int currRow = 0; currRow = dataGridView1.CurrentRow.Index;
   dataGridView1.ClearSelection();
       dataGridView1.Rows[currRow].Selected = true; 

Upvotes: 1

Related Questions