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. Image for the cookie policy date
close icon

Non rendered Grid

I'm rendering a grid with:

@(Html.EJ().Grid<Solicitud>("FlatGrid")
    .Datasource(new List<Solicitud>
    {
        new Solicitud
        {
            EAN="EAN",
            Estado="Estado",
            Solicitante = "Solicitante"
        }
    }.AsEnumerable())
 
    .AllowSorting()
    .AllowPaging()
    .Columns(col =>
    {
        col.Field("Estado").HeaderText("Estado").Add();
        col.Field("EAN").HeaderText("Código de barras").Add();
        col.Field("Solicitante").HeaderText("Solicitante").Add();
    }))
But I only get a <div id="FlatGrid"></div> on my html...

I'm missing something?


1 Reply

GV Gowthami V Syncfusion Team March 10, 2015 01:04 PM UTC

Hi Gonzalo,

Thanks for using syncfusion’s product.

We have anlyzed your code snippet and we suspect that you may missed to provide the @(Html.EJ().ScriptManager())  in the Layout page and hence the “div” element alone is created.

For your kind information, the ASP.Net MVC Controls will render in two mode, they are

1. Unobtrusive mode.

2. Non-unobtrusive mode.

Unobtrusive Mode

The ASP.Net MVC Controls will render in Unobtrusive mode when setting the “UnobtrusiveJavascriptEnabled” as true in web.config file.

[webConfig]

<appSettings>

    . . . .

    <add key="UnobtrusiveJavaScriptEnabled" value="true" />

  </appSettings>

When UnobtrusiveJavaScriptEnabled is set as true, then we  have to refer the “ej.unobtrusive.min.js” in the Layout page.

[Layout.vbhtml]

    <script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")" type="text/javascript"></script>

Non-unobtrusive Mode

The ASP.Net MVC Controls will render in Non-unobtrusive mode when setting the “UnobtrusiveJavascriptEnabled” as false in web.config file and also need to include the@(Html.EJ().ScriptManager())  in the Layout page.

[webconfig]

<appSettings>

    . . . .

    <add key="UnobtrusiveJavaScriptEnabled" value="false" />

  </appSettings>

When UnobtrusiveJavaScriptEnabled is set as false, then we  have to include the@(Html.EJ().ScriptManager())   in the Layout page as belows

[Layout.vbhtml]

<script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")" type="text/javascript"></script>

  . . . . . .

@(Html.EJ().ScriptManager())  

For your convenience, we have created a simple grid sample in Asp.net MVC and the same can be downloaded from the below location.

Sample Loction: http://www.syncfusion.com/downloads/support/directtrac/general/example480283158.zip


Please let us know if you have any other concerns.

Regards,
Gowthami V.



Loader.
Live Chat Icon For mobile
Up arrow icon