Gridview Row As A Link

Is there any other method to make the GridView Row as a link, other than extending the GridView Class and overriding the Rendertablerow functions

Maybe with javascript.

You can simulate a link like behavior - by coding on [font="Lucida Console"]click[/font] method for the [font="Lucida Console"]tr[/font] element. Use [font="Lucida Console"]rowOptions[/font] property of the grid to add specific classes or HTML attributes for each row (you can use Closure functions to do this).

this is possible through this e.g. if you a use js to do some stuff like Kartik V mentioned. e.g.


'rowOptions' => ['onclick'=>'js:alert("test");'],



But you can also add code before and after each row by this


'beforeRow'=> function() {return '<a href="www.test.de">';},

'afterRow'=>  function() {return'</a>';},

The "example code" doesnt make sense here because it is not correct html code, but i guess you can get some inspiration depending of what you wanted to to.


<a href="www.test.de">

<tr data-key="375"><td>375</td><td>...</td></tr>

</a>

regards Horizons