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

MVC Grid Ajax Problem

3 Answers 149 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.
ibrahim
Top achievements
Rank 1
ibrahim asked on 24 Aug 2010, 01:00 PM
It is solved.

Hi, in my grid sample I want to do ajax binding but it works as server binding. And ClientTemplate property doesn t work. What's the problem, could you tell me? Thanks.

Source Code:

Html.Telerik().Grid(Model.user_process_response.UserPerformanceProcess)
                                .Name("Process")
                                .Columns(columns =>
                                    {
                                        columns.Bound(o => o.REGISTARY_NO).Width(100).Title("RwgisterNo");
                                        columns.Bound(o => o.FIRST_NAME).Width(100).Title("User");
                                        columns.Bound(o => o.REGISTARY_NO)
                                                .ClientTemplate("<a href='#' onclick='OpenGridEditModal(<#=REGISTARY_NO#>)'>link</a>"
                            }).DataBinding(dataBinding => dataBinding.Ajax().Select("Process_ManagerControl", "_User_Manager_Mapping"))
                            .Sortable()
                            .Pageable( paging => paging.PageSize(2))
                            .Render();

3 Answers, 1 is accepted

Sort by
0
jpchenot
Top achievements
Rank 2
answered on 22 Jun 2011, 04:03 PM
Hi.

You need to remove the binding and declare you grid like so:

Html.Telerik().Grid<T>()

T represents the type of your model, or more precisely of the method that you are calling on the model. If you bind the model to the grid, it automatically assumes that the grid will use server-side binding and the clienttemplate will only be called during the next ajax call.

I hope this helps.
0
Andrew
Top achievements
Rank 1
answered on 05 Jul 2011, 11:02 AM
would you tell me how did you resoled?
0
Balu
Top achievements
Rank 1
answered on 25 Oct 2011, 01:11 PM
thats an easy fix you don't need to specify the data to the grid while declaring, Instead specify the type. The grid will fetch the data from .Select() method defined in the controller.

Thanks
Balu Chand
Tags
General Discussions
Asked by
ibrahim
Top achievements
Rank 1
Answers by
jpchenot
Top achievements
Rank 2
Andrew
Top achievements
Rank 1
Balu
Top achievements
Rank 1
Share this question
or