These are the steps for the installation of the GridMvc component:
-
Install the GridMvcCore nuget package on your project.
-
Add the following code to the Startup class:
public void ConfigureServices(IServiceCollection services) { services.AddGridMvc(); }
It will add references to the required stylesheets, script files and resources from the nuget package.
-
Install the following client libraries on the project:
- bootstrap
- bootstrap-datepicker
- jquery
-
Add the following lines to the _Layout.cshtml view or directly to the page:
<link rel="stylesheet" href="~/css/bootstrap/css/bootstrap.css" /> <link rel="stylesheet" href="~/lib/bootstrap-datepicker/css/bootstrap-datepicker.css" /> <link rel="stylesheet "href="~/css/gridmvc.css" /> <script src="~/lib/jquery/jquery.js" type="text/javascript"></script> <script src="~/lib/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script> <script src="~/js/gridmvc.js" type="text/javascript"></script>
It will call the required style sheet and script files. gridmvc.css and gridmvc.js files will be loaded from the GridMvCore nuget package, so it is not necessary to copy them to you project.
- For each additional language add the following lines to the _Layout.cshtml view or directly to the page:
It will call the required style sheet and script files. The gridmvc-lang-xx.js file will be loaded from the GridMvCore nuget package, so it is not necessary to copy it to your project.
<script src="~/js/gridmvc-lang-de.js" type="text/javascript"></script> <script src="~/lib/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js" type="text/javascript"></script>
If you want to use the client side object model instead of using the default grid server management, you have to follow the following steps:
-
Install the following client libraries on the project:
- URI.js
-
Add the following lines to the page that will use the client side object model:
<script src="~/js/gridmvc-ajax.js" type="text/javascript"></script> <script src="~/lib/URI.js/URI.js" type="text/javascript"></script>
The gridmvc-ajax.js file will be loaded from the nuget package, so it is not necessary to copy it to your project.