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

ASP.NET MVC Grid

Hi, 
 I'm implementing grid control in my project, but I have a problem with that.
Grid doesn't show the data.

Can you help me?

Best regards,



Attachment: SER_Bootstrap_Test_1f47aa48.zip

3 Replies

GV Gowthami V Syncfusion Team July 23, 2015 12:06 PM UTC

Hi Sergio,

Thanks for using Syncfusion products.

We have listed out the causes for why grid is not rendered in your application.

1.       The scripts that you have referred in the layout page is differ from the files in the specified script folders. For Example , you have referred  “jquery.easing.1.3.min.js which is not in the Scripts folder.

2.       And also you have referred both individual (ej.widgets.core.min.css and ej.theme.min.css) and the compressed css files (ej.web.all.min.css). We suggest you to refer the compressed file (ej.web.all.min.css) in your application, because it contains both ej.widgets.core.min.css and ej.theme.min.css.

3.        For rendering MVC controls there is no need to refer the script file “ej.webform.min.js” which depend to ASP.NET web form and also you have missed to refer the script file “jsrender.min.js” which is necessary to render the grid template.

 Please refer the below screenshot for identify the mistakes in your code snippet .



4.       You have missed to include the Script Manager in the View page or in _Layout.cshtml file in the following location <ApplicationRootDirectory>\Views\Shared\_Layout.cshtml file. The Script Manager is added after the control creation or it is added before the </body> tag as follows:

[_Layout.cshtml]


     @Html.EJ().ScriptManager()


5.       You have enabled the Unobtrusive mode in web.config file. The Unobtrusive is enabled by default when you create the application. When Unobtrusive is enabled you can render the control using Html5 attributes. Otherwise, the control is rendered through the script.


        Please refer the below screenshot.




6.       When unobtrusive is enabled, then we have to include the ej.unobtrusive.min.js script file in _Layout.cshtml. The unobtrusive Script file contains the unobtrusive script of your Essential JS Widgets. You can refer this from the Scripts folder.

Please refer the below screen shot.



Please refer the below snippet for referring the necessary scripts , css files and Script Manager for rendering grid control in _Layout.cshtml file.

_Layout.cshtml


<head>

. . . .


@*<%--Required CSS references for Syncfusion control rendering--%>*@


   <link rel='nofollow' href="~/Content/ej/web/bootstrap-theme/ej.web.all.min.css" rel="stylesheet" />


    @*<%--Required script references for ASP.NET controls--%>

    <%--Refer the base jquery script before referring all other script files--%>*@

  

    <script src="~/Scripts/jquery-2.1.4.min.js"></script>

    <script src="~/Scripts/jquery.easing.1.3.min.js"></script>

    <script src="~/Scripts/jquery.globalize.min.js"></script>

    <script src="~/Scripts/jquery.validate.js"></script>

    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script>

    <script src="~/Scripts/jsrender.min.js"></script>

    <script src="~/Scripts/ej/ej.web.all.min.js"></script>
    <script src="~/Scripts/ej/ej.unobtrusive.min.js"></script> </head>

<body>

. . . .
. . . .
. . . .

    @Html.EJ().ScriptManager()

    @RenderSection("scripts", required: false)
</body>


Note: Please refer the script and css files in the above mentioned order.

Please refer the below unedited Introduction document for Getting Started with Syncfusion controls.

Document Link: Introduction

Please refer the above document under Introduction -> Server Side Wrappers -> MVC -> Create Manually for more clarification about necessary scripts, css and Need of Script Manager and use of Unobtrusive mode.

Please try the mentioned changes and let us know if you have any queries.

Regards,
Gowthami V.


SE Sergio Expósito replied to Gowthami V July 24, 2015 10:49 AM UTC

Hi Sergio,

Thanks for using Syncfusion products.

We have listed out the causes for why grid is not rendered in your application.

1.       The scripts that you have referred in the layout page is differ from the files in the specified script folders. For Example , you have referred  “jquery.easing.1.3.min.js which is not in the Scripts folder.

2.       And also you have referred both individual (ej.widgets.core.min.css and ej.theme.min.css) and the compressed css files (ej.web.all.min.css). We suggest you to refer the compressed file (ej.web.all.min.css) in your application, because it contains both ej.widgets.core.min.css and ej.theme.min.css.

3.        For rendering MVC controls there is no need to refer the script file “ej.webform.min.js” which depend to ASP.NET web form and also you have missed to refer the script file “jsrender.min.js” which is necessary to render the grid template.

 Please refer the below screenshot for identify the mistakes in your code snippet .



4.       You have missed to include the Script Manager in the View page or in _Layout.cshtml file in the following location <ApplicationRootDirectory>\Views\Shared\_Layout.cshtml file. The Script Manager is added after the control creation or it is added before the </body> tag as follows:

[_Layout.cshtml]


     @Html.EJ().ScriptManager()


5.       You have enabled the Unobtrusive mode in web.config file. The Unobtrusive is enabled by default when you create the application. When Unobtrusive is enabled you can render the control using Html5 attributes. Otherwise, the control is rendered through the script.


        Please refer the below screenshot.




6.       When unobtrusive is enabled, then we have to include the ej.unobtrusive.min.js script file in _Layout.cshtml. The unobtrusive Script file contains the unobtrusive script of your Essential JS Widgets. You can refer this from the Scripts folder.

Please refer the below screen shot.



Please refer the below snippet for referring the necessary scripts , css files and Script Manager for rendering grid control in _Layout.cshtml file.

_Layout.cshtml


<head>

. . . .


@*<%--Required CSS references for Syncfusion control rendering--%>*@


   <link rel='nofollow' href="~/Content/ej/web/bootstrap-theme/ej.web.all.min.css" rel="stylesheet" />


    @*<%--Required script references for ASP.NET controls--%>

    <%--Refer the base jquery script before referring all other script files--%>*@

  

    <script src="~/Scripts/jquery-2.1.4.min.js"></script>

    <script src="~/Scripts/jquery.easing.1.3.min.js"></script>

    <script src="~/Scripts/jquery.globalize.min.js"></script>

    <script src="~/Scripts/jquery.validate.js"></script>

    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script>

    <script src="~/Scripts/jsrender.min.js"></script>

    <script src="~/Scripts/ej/ej.web.all.min.js"></script>
    <script src="~/Scripts/ej/ej.unobtrusive.min.js"></script> </head>

<body>

. . . .
. . . .
. . . .

    @Html.EJ().ScriptManager()

    @RenderSection("scripts", required: false)
</body>


Note: Please refer the script and css files in the above mentioned order.

Please refer the below unedited Introduction document for Getting Started with Syncfusion controls.

Document Link: Introduction

Please refer the above document under Introduction -> Server Side Wrappers -> MVC -> Create Manually for more clarification about necessary scripts, css and Need of Script Manager and use of Unobtrusive mode.

Please try the mentioned changes and let us know if you have any queries.

Regards,
Gowthami V.

Hi, Gowthami V.

I followed your recommendations and it's all ok.
Grid data it's ok.

Thank you so much.
Best regards,
Sergio

Attachment: Modern_Business__Listado_de_Clientes_e10c080d.zip


GV Gowthami V Syncfusion Team July 27, 2015 04:21 AM UTC

Hi Sergio,

Thanks for your update.

We are happy to hear that your issue has been resolved.

Please get back to us if you need further assistance. We will happy to assist you.

Thanks & Regards,

Gowthami V.

Loader.
Live Chat Icon For mobile
Up arrow icon