I would like to know what event should I use in order to click the whole row of datagridview and provide an action after clicking. I already use the cellcontentclick but only a specific cell lets an action be done.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming you are talking about a
WinFormsDataGridViewcontrol.You need to handle the
RowStateChangedevent. TheDataGridViewRowStateChangedEventArgsobjectecontains aStateChangedproperty, and you need to check if the state isSelected. As a slight warning, the value will be returned asSelectedboth when a row has become selected and become unselected, so you may need some additional logic to check ife.Rowis selected or not depending on your scenario.