• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1346
  • Last Modified:

DataGridView deselect row

Hello,

I am using Windows Forms, VS 2010, Windows 7.

I want to programmatically deselect the row in DataGridView. I know for function ClearSelection(), but this function deselets all selected rows. What I want is to deselect just one of the selected rows. Is this possible?


Greetings, Frenky
0
AntonioRodrigo
Asked:
AntonioRodrigo
1 Solution
 
CodeCruiserCommented:
Have you tried?

dgv.Rows(index).Selected = False
0
 
santhimurthydCommented:
Check the below option

myDataGrid.UnSelect(myDataGrid.CurrentRowIndex);

MSDN reference
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagrid.unselect.aspx

0
 
AntonioRodrigoAuthor Commented:
santhimurthyd: your solution is for DataGrid, not for DataGridView.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now