This is a migrated thread and some comments may be shown as answers.

[Solved] Row Selection with Server Binding

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin Burandt
Top achievements
Rank 1
Kevin Burandt asked on 07 Feb 2011, 05:27 PM
I have server binding with paging, etc. working using IQueryable and verified with the profiler as returning only the selected page and going to a detail page using a column action

columns.Template(s => Html.ActionLink("Edit", "Edit", new { s.Id }))
                            .ClientTemplate("<a href=\"" + Url.Action("Edit", "Customer") + "/<#= Id#>\">Edit</a>")
                            .Width(50)
                            .Title("Edit");

And this works but is not what I want either:

.DataBinding(dataBinding => dataBinding
                .Server()
                .Select("Edit", "Customer")

 I want to be able to click anywhere on a row and invoke an action as in the AJAX selection client side example ClientSideDemo.

1) Is an action on row selection only possible using AJAX binding?
2) If yes, how?  If not and I use AJAX binding how can I take advantage of the grid features such as column sort, filtering, etc. server-side?

Thanks,
Kevin

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Feb 2011, 09:08 AM
Hello Kevin Burandt,

 The Select() databinding configuration is used for retrieving the items - like in SQL. It is not for row selection. In your case you can make the grid Selectable() and handle the OnRowSelect event. There you can  simulate a click() of the edit link button or just perform navigation to the right url. Here is a short example:

function onRowSelect(e) {
    $(e.row).find("a").click(); 
}

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Kevin Burandt
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or