Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I can´t find anything like onrowclick or onclick event, is possible to fire event when you click on gridview row?

share|improve this question
what kind of event you'd like to raise ? – matzone 22 mins ago
I want to raise onclick like event – Mikelon85 19 mins ago
1  
Try this link .. – matzone 6 mins ago
Thanks i was finding something like that. Is free for commercial use? – Mikelon85 4 mins ago
1  
As you see in the bottom .. This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) – matzone 2 mins ago

2 Answers

Not using standard ASP.NET control events, since one does not exist for that purpose. Instead, you could use client-side JavaScript to issue an AJAX request, exposing a static WebMethod to handle the thing: but, without knowing why, this might be absolutely useless.

share|improve this answer

do this in grid RowDataBound event:

if(e.Row.RowType == DataControlRowType.DataRow)
{
  e.Row.Attributes["onClick"] = "";//any thing you want.
}
share|improve this answer
with this the event rises when data is loaded into a row, isn´it? – Mikelon85 20 mins ago
yes, you are right – Altaf Sami 18 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.