I have an onclientclick event going on in the gridview rows, but I want to call a serverside method when I click anywhere on a row. How can I accomplish this WITHOUT the use of an extra column + select button + onselectedindexchanged?
Thank you
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 not sure what exactly you are trying to accomplish here but I don’t think you need to use a grid view event at all. I’m assuming you are going to use some javascript to handle the click anywhere on a row correct? You could put an asp link button in one of the existing columns using CSS to hide it so it’s not visible. Then have your javascript click the button. Then the link button can have it’s own backing method like normal.
You might want to have the link button do a command instead of an onClick so you can pass a command argument of the row index or data item Id.
Would that handle your situation?