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

Grid, ajax and server selection

1 Answer 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gunawan Thio
Top achievements
Rank 1
Gunawan Thio asked on 01 Apr 2011, 08:27 AM
Hi there,

I need ot have ajax for grid's sorting and filtering, and also have one column for server selection command. But somehow:

1. After page load, select from grid --> routed properly
2. After page load, sort column, select from grid --> its not routed properly

Please let me know if i set everyting correctly, Below is the view:


@(Html.Telerik().Grid(Model).Name("IssuerGrid")
    .DataKeys(k =>
    {
        k.Add(o => o.Code).RouteKey("Code");
    })
    .Columns(columns =>
    {
        columns.Bound(o => o.Code).Width(100);
        columns.Bound(o => o.Name).Width(400);
        columns.Bound(o => o.Description);

        columns.Command(commands => commands.Select()).Title("Details");
    })
    .DataBinding(dataBinding =>
    {
        dataBinding.Server()
            .Select("Details", "Issuer");

        dataBinding.Ajax()
            .Select("_Index", "Issuer").Enabled(true);
    })
    .BindTo(Model)
    .Scrollable(scrolling => scrolling.Enabled(true))
    .Sortable(sorting => sorting.Enabled(true))
    .Pageable(paging => paging.Enabled(true))
    .Filterable(filtering => filtering.Enabled(true))
    .Groupable(grouping => grouping.Enabled(true))
    .Selectable())


1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Apr 2011, 12:29 PM
Hi Gunawan Thio,

 Currently the Select command works only with server binding. If you need something similar for ajax binding you can set the client template of a column like this:


columns.Bound(o => o.Code).ClientTemplate("<a href='/Select/<#=Code#>'>Select</a>");

Regards,
Atanas Korchev
the Telerik team
Tags
General Discussions
Asked by
Gunawan Thio
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or