Getting Started with Ignite UI igGrid

Hello everyone, hope you're doing well. I received an Infragistics Ultimate subscription yesterday and I'm really happy about it. It is gifted to every C# Corner MVP. Thank you Casey McGuigan, Infragistics, for the lovely gift and C# Corner for making it happen. 
 
 
 
 
 
and I was like,
 
 
 
Thus, I happily headed to Infragistics.com, redeemed my coupon and I had the subscription activated in my account. I can explore a whole bunch of applications. They offer a wide range of intuitive UI tools. "JavaScript / HTML5" controls are my first love here and I'm gonna explore them first.
 


From the list of available downloads, I chose "Ignite UI 2016 Vol.1 Complete Bundle". I downloaded and installed it. To proceed, go to your Program Files > Infragistics > 2016.1 > Ignite UI folder.
 

Inside the folder, I saw a few folders that contain the files for a variety of projects. The lovely part is, if you're a developer, working with ASP.NET MVC, there's a library available for you.
 
For now, I wanted to give JS/HTML combination a start. Thus, I created a blank Application. I also pasted a CSS & a JS folder into the project from the above location.
 


I have highlighte a few of them. Under CSS,you need to add "infragistics.css" from the Structure folder and any theme of your choice from the Themes folder. For the script part, two libraries are required at the basic level: "infragistics.core.js" and "infragistics.lob.js".
 
Please note that Ignite UI has a dependency on jQuery and jQuery UI. Hence, I added them too, using NuGet commands:

Install-Package jQuery
Install-Package jQuery.UI.Combined
 
Thus, I wanted to try igGrid, just out of interest. I took a blank HTML5 document and added the following required JS & CSS files: 
I also added a container to hold my grid:
 
OK, the structure is ready now. The time to write the scripts to generate the grid has come and the script is as follows: 

Next, initialize the grid and bind the data to it. 
 
As simple as that. I'm just amazed that it allow me to generate a grid, using a couple of lines of the code and nothing more. Wow! Surprisingly, that's all the code I had to write.
 
Here's the complete HTML for the page: 
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4.     <title></title>  
  5.     <meta charset="utf-8" />  
  6.     <link href="css/themes/metro/infragistics.theme.css" rel="stylesheet" />  
  7.     <link href="css/structure/infragistics.css" rel="stylesheet" />  
  8.     <script src="Scripts/jquery-3.0.0.js"></script>  
  9.     <script src="Scripts/jquery-ui-1.11.4.js"></script>  
  10.     <script src="js/infragistics.core.js"></script>  
  11.     <script src="js/infragistics.lob.js"></script>  
  12. </head>  
  13. <body>  
  14.   
  15.     <div id="dataGrid">  
  16.         <!-- this is where grid will be initialized. -->  
  17.     </div>  
  18.   
  19. <script>  
  20.   
  21.     //prepare data  
  22.     var data = [  
  23.         { FirstName: "John", LastName: "M.", ContactNo: "9898989801" },  
  24.         { FirstName: "Raj", LastName: "Kumar", ContactNo: "9898989802" },  
  25.         { FirstName: "Manoj", LastName: "Sarkar", ContactNo: "9898989803" },  
  26.         { FirstName: "Neeraj", LastName: "Pal", ContactNo: "9898989804" },  
  27.         { FirstName: "Praveen", LastName: "Yadav", ContactNo: "9898989805" },  
  28.         { FirstName: "Shubham", LastName: "Saxena", ContactNo: "9898989806" },  
  29.         { FirstName: "Vaibhav", LastName: "Kohli", ContactNo: "9898989807" }  
  30.     ];  
  31.   
  32.   
  33.     //on load  
  34.     (function ($) {  
  35.         //initialize the grid  
  36.         $('#dataGrid')  
  37.             .igGrid({  
  38.                 dataSource: data  
  39.             });  
  40.     })(jQuery);  
  41.   
  42.   
  43. </script>  
  44. </body>  
  45. </html> 
And I hit F5, and I got this nice looking grid on my screen. Claps for igGrid! Just with a few lines of code you will be able to create a beautiful and responsive grid layout. 
 
 
igGrid is very flexible and it allows a whole lot of grid customization. That's it for now, hope you loved it too.
 
Download the sample code from my github repo here.
 
I will be exploring every option of it and will keep you posted. Follow me for the updates in regards to further posts on Ignite UI. Hope you enjoyed reading this. Please share your valuable feedback in the comments section.


Similar Articles