Click here to Skip to main content
12,512,683 members (26,022 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
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
v2

1 solution

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

Solution 1

Set the SelectionMode property to DataGridViewSelectionMode.FullRowSelect
  Permalink  
Comments
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 | Mobile
Web02 | 2.8.160929.1 | Last Updated 16 Feb 2013
Copyright © CodeProject, 1999-2016
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