We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid and other controls do not appear in PartialView

Thread ID:

Created:

Updated:

Platform:

Replies:

128598 Jan 31,2017 01:10 PM UTC Mar 9,2017 06:19 AM UTC ASP.NET MVC 5
loading
Tags: Grid
Carlos Junior
Asked On January 31, 2017 01:10 PM UTC

Hello!

Why are the controls not rendered within PartialView?
When my application calls a PartialView, the grid is not rendered and the DatePicker control is not rendered correctly in this PartialView.

The PartialView is called like this: $('#contents').load("@Url.Action("DashboardIndex","Dashboard"));
DashboardIndex is the PartialView.

Att.
Junior

Carlos Junior
Replied On January 31, 2017 04:39 PM UTC

Problem solved!

I added the following statement at the end of PartialView: @Html.EJ().ScriptManager()

Att.
Junior

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On February 1, 2017 04:39 AM UTC

Hi Carlos, 
 
We are happy to hear that you have resolved your problem. Please get back to us, if you require further assistance on this. 
 
Regards, 
Seeni Sakthi Kumar S. 


Nicola
Replied On March 8, 2017 11:28 PM UTC

Hello,
I have the same problem, I tried to add the : @Html.EJ().ScriptManager() at the end of PartialView but doesn't work !

---------------------------------------------------------------------------------------
In the principal view
---------------------------------------------------------------------------------------

<div id="partialIncassi">
    @{ Html.RenderAction("ReportIncassi", "Report", Model);}
    </div>

 $("#button_filter").click(function () {
 $('#partialIncassi').load('@Url.Action("ReportIncassi", "Report")',$("#filtroForm").serialize());

---------------------------------------------------------------------------------------
PartialView (_ReportIncassiGroup)
---------------------------------------------------------------------------------------
<div class="row">


        @(Html.EJ().Grid<AfroditeProPortal.Models.IncassiModel>
                ("Grid")
                .Datasource((IEnumerable<object>)ViewBag.incassi)  
                .AllowGrouping()
                .GroupSettings(group => { group.GroupedColumns(col => { col.Add("tipoArticolo"); }); })
                .Locale("it-IT")
                .ShowSummary()
                .SummaryRow(row =>
                {
                    row.ShowTotalSummary(true)
                    .SummaryColumns(col =>
                    {
                        col.SummaryType(SummaryType.Sum)
                    .DisplayColumn("qta")
                    .DataMember("qta")
                    .Prefix("Quantità = ")
                    .Format("{0:N0}")
                    .Add();
                        col.SummaryType(SummaryType.Sum)
                    .DisplayColumn("importo")
                    .DataMember("importo")
                    .Prefix("Totale = ")
                    .Format("{0:C}")
                    .Add();
                        col.SummaryType(SummaryType.Sum)
                    .DisplayColumn("importoScontato")
                    .DataMember("importoScontato")
                    .Prefix("Totale = ")
                    .Format("{0:C}")
                    .Add();
                        col.SummaryType(SummaryType.Sum)
                   .DisplayColumn("omaggio")
                   .DataMember("omaggio")
                   .Prefix("Totale = ")
                   .Format("{0:C}")
                   .Add();
                        col.SummaryType(SummaryType.Sum)
                  .DisplayColumn("omaggi")
                  .DataMember("omaggi")
                  .Prefix("Omaggi = ")
                  .Format("{0:N0}")
                  .Add();
                    }).Add();
                })
                .Columns(col =>
                {
                    col.Field(c => c.sesso).HeaderText("Sesso").Width("10%").Add();
                    col.Field(c => c.tipoArticolo).HeaderText("Tipo").Width("15%").Add();

                    col.Field(c => c.qta).HeaderText("Quantità").Width("15%").TextAlign(TextAlign.Center).Format("{0:N0}").Add();
                    col.Field(c => c.importo).HeaderText("Importo").Width("15%").TextAlign(TextAlign.Center).Format("{0:C}").Add();
                    col.Field(c => c.importoScontato).HeaderText("Sconti").Width("15%").TextAlign(TextAlign.Center).Format("{0:C}").Add();
                    col.Field(c => c.omaggio).HeaderText("Omaggi").Width("15%").TextAlign(TextAlign.Center).Format("{0:N0}").Add();
                    col.Field(c => c.omaggi).HeaderText("Importo omaggi").Width("15%").TextAlign(TextAlign.Center).Format("{0:C}").Add();

                })
                )

</div>

@Html.EJ().ScriptManager()

---------------------------------------------------------------------------------------
Controller
---------------------------------------------------------------------------------------
        public PartialViewResult ReportIncassi(ReportIncassiFiltro filtro)
        {

            ReportData reportData = new ReportData();
            ViewBag.incassi = reportData.getIncassiSerProd(filtro);

            return PartialView("_ReportIncassiGroup");
        }







Nicola
Replied On March 8, 2017 11:41 PM UTC


I changed the javascritp .load with ajax call and i used  ej.widget.init without @Html.EJ().ScriptManager() in PartialView, and works !!

 $.ajax({
                        url: '@Url.Action("ReportIncassi", "Report")',
                        data:$("#filtroForm").serialize(),
                        success: function (doc) {
                            $("#partialIncassi").html(doc);
                            ej.widget.init($("#partialIncassi"));
                        }
                    }); 

Venkatesh Ayothi Raman [Syncfusion]
Replied On March 9, 2017 06:19 AM UTC

Hi Nicola, 
Thanks for the update. 
The reason is UnobtrusiveJavaScriptEnabled is enabled in the webconfig file like as follows, 
<configuration> 
  <configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> 
  </configSections> 
  <connectionStrings> 
    . . . 
  </connectionStrings> 
  <appSettings> 
            . . . 
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/> 
    . . . 
  </appSettings> 

If it is enabled in your project then we should use ej.widget.init for partial view as like your code example. We are happy to hear that your requirement is achieved. 
Thanks, 
Venkatesh Ayothiraman. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;