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

Grid MVC in a PartialView

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 16 Jan 2017, 08:59 PM

Hi,

I am using a Grid MVC in a PartialView and when I try add a new record, the PartialView is rendered and obviously the page lost styles and scripts.
How can I use all functionalities of a Grid MVC in a PartialView.

This is my code.

01.@(Html.Kendo().Grid(Model.RelatedCompanies)
02.    .Name("Relatedcompanies")
03.    .ToolBar(tools => tools.Create().Text("Agregar nuevo"))
04.    .Columns(columns =>
05.    {
06.        columns.Bound(p => p.ThirdParties.NumIdentificationThirdParty);
07.        columns.Bound(p => p.ThirdParties.BusinessName).ClientTemplate("#= ThirdParties.BusinessName #" +
08.            "<input type='hidden' name='RelatedCompanies[#= index(data)#].ThirdParties.BusinessName' value='#= ThirdParties.BusinessName #' />"
09.        );
10.        columns.Bound(p => p.DescriptionRelatedCompany).ClientTemplate("#= DescriptionRelatedCompany #" +
11.            "<input type='hidden' name='RelatedCompanies[#= index(data)#].DescriptionRelatedCompany' value='#= DescriptionRelatedCompany #' />"
12.        );
13.    })
14.    .Events(events => events
15.        .Change("relatedCompaniesOnChange")
16.    )
17.    .DataSource(dataSource => dataSource
18.        .Server()
19.        .Model(model =>
20.        {
21.            model.Id(p => p.Id);
22.        })
23.        .Create(update => update.Action("CreateCompany", "ThirdPartiesDef"))
24.    )
25.)

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 18 Jan 2017, 01:38 PM
Hi Daniel,

The Grid component should work as expected when you place it in a PartialView. Would you open the browser console by pressing F12 and see if there are any errors listed there?

Also, would you describe how you are loading the PartialView? Is the behavior different when you place the Grid directly in theView?


Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or