Problem with SetOnSelectedRowEvent...

Jul 12, 2011 at 3:47 PM


I need to use Url.Action in SetOnSelectedRowEvent?

I need to do something like that:

 .SetOnSelectedRowEvent("window.History.pushState(null, null, '@Url.Action("Edit","Meta")' + id);")



Jul 12, 2011 at 4:49 PM
Edited Jul 12, 2011 at 4:50 PM

You should supply the SetOnSelectedRowEvent method a js function name that the grid will invoke when a row's selected.


And somewhen in the page you should have the following script tag:

<script language="javascript" type="text/javascript">
function onRowSelected(selectedRowModel)
/* Your code here */
Jul 12, 2011 at 6:44 PM


I did that :

function onRowSelected(selectedRowModel) {
        window.History.pushState(null, null, "@Url.Action("Edit","Meta")" +'/'+ selectedRowModel.Id);

Worked, but i dont know if its the best way...

Another question with the same subject...

Is it posible to set the SetListUrl with Url.Action ? I´m with a odd problem using that :


When I access my page like that : localhost/Meta everthing works great... http://localhost/Meta/List?

But when I try that : localhost/Meta/ my SetListUrl does no work... It try to get from : http://localhost/Meta/Meta/List?

Any idea?



Jul 13, 2011 at 5:43 AM

Shouldnt thid do the work: .SetListUrl(Url.Action("Edit",Meta"))... ?

As for the onRowSelected - if you have a better design offer I'd love to hear it

Jul 13, 2011 at 11:17 AM

.SetListUrl(Url.Action("Edit",Meta")) worked fine... Thanks...

I´m trying to do something like that :

.SetOnSelectedRowEvent( "window.History.pushState(null, null," + "'" + Url.Action("Edit", "Meta") + "/id')")

But that generates :



Jul 13, 2011 at 1:44 PM

Yeah! I did it...

.SetOnSelectedRowEvent( "window.History.pushState(null, null," + "'" + Url.Action("Edit", "EmpresaContratada") + "/' + id)")