Click here to Skip to main content
13,193,829 members (44,778 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi friends
In datagridview cell_click event how can select entire row by selecting a single cell.
By this code we can select row.
datagridviewrow row=datagridview.rows[e.rowindex].
but clicking a cell, i want entire cell of row is selected with selected color
Posted 16-Feb-13 4:54am
Updated 16-Feb-13 5:05am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Set the SelectionMode property to DataGridViewSelectionMode.FullRowSelect
baskaran chellasamy 16-Feb-13 11:29am
Thanks OrginalGriff. But one thing when first click on the cell, it is not selected,but after a second click on any cell, the row fully selected. what happen
OriginalGriff 16-Feb-13 12:10pm
It works fine for me.
Are you handling any events?
Maciej Los 16-Feb-13 12:51pm
My 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171018.2 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100