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

[Solved] Second Tier MVC DataGrid not sending AJAX requests

2 Answers 112 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.
Sam
Top achievements
Rank 1
Sam asked on 17 Feb 2012, 10:33 PM
Hi,

I'm trying to use an MVC datagrid embedded in a parent datagrid. It is shown when drilling down into a row. I followed the template on the website, but I cannot get it to work. The child datagrid is not sending any AJAX requests. I tried also using a dummy method in the controller that doesn't take any parameters to see if that was the issue, and that was not called either.

Thanks for any help.
@{
            Html.Telerik()
                .Grid<NotesItem>()
                .Name("NotesGrid")
                .DetailView(details => details.ClientTemplate(Html.Telerik()
                    .Grid<VersionInformation>()
                    .Name("Documents_<#= Path #>")
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("GetDocumentVersionHistoryAjax", "Home")), new { path = "<#= Path #>" }))
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.Url);
                        columns.Bound(o => o.CreatedBy).Title("Changes By");
                        columns.Bound(o => o.CreatedDate).Format("{0:MM/dd/yyyy}");
                        columns.Bound(o => o.VersionId);
                    })
                    .Pageable()
                    .Sortable()
                    .ToHtmlString()
                ))
                .DataBinding(dataBinding => dataBinding.Ajax().Select("GetDocumentDataAjax", "Home"))               
                .Columns(columns =>
                {                   
                    columns.Bound(o => o.CheckedOutTo).Width(200).Title("Checked Out");
                    columns.Bound(o => o.Name).Title("Document");
                    columns.Bound(o => o.CreatedBy).Format("{0:MM/dd/yyyy}").Width(120);
                    columns.Bound(o => o.Version).Width(100).Title("Last Check In Comment");
                })               
                .Groupable()
                .Sortable()
                .Pageable()
                .Filterable()
                .Render()
                ;
            }

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 22 Feb 2012, 10:16 AM
Hi Sam,

I do not see any problems in the code you shared. Could you please attach the sample project you which you are using, so I can investigate what goes wrong?

Kind Regards,
Petur Subev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Sam
Top achievements
Rank 1
answered on 28 Feb 2012, 03:27 PM
For whatever reason the .Name("Documents_<#= Path #>") was not working correctly. When I changed this to an Id field, the the code worked.
Tags
General Discussions
Asked by
Sam
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Sam
Top achievements
Rank 1
Share this question
or