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

[Solved] Editor not workin with grid using ajax

2 Answers 99 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Remco Dekkers
Top achievements
Rank 1
Remco Dekkers asked on 02 Mar 2011, 04:26 PM
I try to use the editor as a ViewUserControl the grid. The grid I load using ajax binding. The edit for is in a popup. When the popup is shown for an existing record the html editor doens't show the content. When typing in the content and saving this new content is send to the action on the server.

I tested this on the examples by changing databding to Ajax and also there it's not working.

EditorInGrid. dataBinding.Server() changed to dataBinding.Ajax()
<%= Html.Telerik()
        .Grid(Model)
        .Name("Grid")
        .DataKeys(keys => keys.Add(e => e.EmployeeID).RouteKey("Id"))
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        .DataBinding(dataBinding => dataBinding.Ajax()
           .Select("EditorInGrid", "Editor")
           .Update("UpdateEmployee", "Editor"))
        .Columns(columns =>
        {
            columns.Bound(e => e.EmployeeID).Width(100);
            columns.Bound(e => e.FirstName);
            columns.Bound(e => e.LastName);
            columns.Bound(e => e.Notes).Width(320).Encoded(false);
            columns.Command(commands => commands.Edit()).Title("Edit").Width(200);
        })
        .Pageable(paging => paging.PageSize(5))
%>

2 Answers, 1 is accepted

Sort by
0
Remco Dekkers
Top achievements
Rank 1
answered on 10 Mar 2011, 10:24 AM
I solved it by setting the content manually in the clientside onEdit event

function onEdit(e) {
    if (e.dataItem)
        $('#Description').data('tEditor').value(e.dataItem.Description);
}
0
Michael
Top achievements
Rank 1
answered on 19 Jul 2011, 11:42 PM
Hello, I am having the same problem you had and solved.  I tried your solution, but still can't get it to work. 

Here is my post, please if you can see what I am doing wrong, let me know.  Thanks!

http://www.telerik.com/community/forums/aspnet-mvc/grid/editor-template-in-grid-is-disabled.aspx

Tags
Editor
Asked by
Remco Dekkers
Top achievements
Rank 1
Answers by
Remco Dekkers
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Share this question
or