In this post we will learn to get it started with Ignite UI in three simple steps. We are going to create a simple IG Grid in the visual studio. Essentially we would create a jQuery based web application using the Visual Studio IDE.
To create the Grid follow the steps as discussed below.
Create a blank web application by choosing ASP.NET Web Application template from the Web tab.
On the next screen we need to select Empty template and click ok.
Once project is created successfully, we need to add reference of the Ignite UI library in the project. There are three different ways we can work with Ignite UI reference.
- Use the CDN
- Download library and add it to the project
- In Visual Studio use the NuGet package manager.
We are going to use NuGet package manager. To use that right click on project and from the context menu choose Manage NuGet Packages. Next search for the Ignite UI.
In the search result, we should get the Ignite UI Trial package as shown in the image above. Install the package in the project.
After successful installation of the Ignite UI package, we will find Ignite UI JS files, CSS files etc. being added to the project in the solution explorer. Along with the required file there are two more files are added for the reference.
We added reference of the
- IG CSS
- IG theme
- IG JS files.
Create a simple Ignite UI Grid
To validate the bootstrapping, let us create a simple Grid with the JSON data. On the HTML, we just need a div element. We can create a div element as shown in the listing below:
Next we have the data in the JSON format as shown in the listing below.
In the real time application JSON data will get downloaded to the application from the REST services or Web API.
Very easily Ignite UI Grid can be created by calling igGrid method on the div element.
In the Grid we are setting the following properties
- Data source. It is set to the JSON object.
- AutogeneratedColumns : It is set to false
- Columns : It is set to the object properties which would be the part of the grid
- Features: In this property sorting , sorting directions can be set. We will discuss more about this in further posts.
This is what all we need to create a simple IG Grid. I hope you find this post useful. Happy coding.