Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Value-Driven AI Roadmap

      September 9, 2025

      This week in AI updates: Mistral’s new Le Chat features, ChatGPT updates, and more (September 5, 2025)

      September 6, 2025

      Designing For TV: Principles, Patterns And Practical Guidance (Part 2)

      September 5, 2025

      Neo4j introduces new graph architecture that allows operational and analytics workloads to be run together

      September 5, 2025

      ‘Job Hugging’ Trend Emerges as Workers Confront AI Uncertainty

      September 8, 2025

      Distribution Release: MocaccinoOS 25.09

      September 8, 2025

      Composition in CSS

      September 8, 2025

      DataCrunch raises €55M to boost EU AI sovereignty with green cloud infrastructure

      September 8, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Finally, safe array methods in JavaScript

      September 9, 2025
      Recent

      Finally, safe array methods in JavaScript

      September 9, 2025

      Perficient Interviewed for Forrester Report on AI’s Transformative Role in DXPs

      September 9, 2025

      Perficient’s “What If? So What?” Podcast Wins Gold Stevie® Award for Technology Podcast

      September 9, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Distribution Release: MocaccinoOS 25.09

      September 8, 2025
      Recent

      Distribution Release: MocaccinoOS 25.09

      September 8, 2025

      Speed Isn’t Everything When Buying SSDs – Here’s What Really Matters!

      September 8, 2025

      14 Themes for Beautifying Your Ghostty Terminal

      September 8, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Unboxing AG-Grid: A Quick Start Guide for Angular Developers

    Unboxing AG-Grid: A Quick Start Guide for Angular Developers

    July 23, 2025

    What is a Grid and Why Ag-Grid?

    A grid is one of the best methods to present data in a structured and understandable way. At a glance, grids help extract concise information efficiently. When working with complex data tables in Angular applications, AG Grid Angular is an excellent choice for developers.AG-Grid is a popular package that simplifies grid implementation while offering extended functionalities such as sorting, filtering, editing, pagination, custom themes, and much more. 

    The enterprise version even includes advanced features like charts, Excel exporting, and row grouping, making it a robust solution for enterprise-grade applications. 

    Community vs Enterprise 

    Community is the free version of ag-grid which has ag-grid-community package.  

    • Basic grid including sorting, filtering, and pagination 
    • Inbuilt themes and custom styling 
    • Custom cell rendering 

    Enterprise consists of a paid version of ag-grid which has ag-grid-enterprise package. 

    • Supports server-side rendering (SSR) 
    • Advanced features such as Excel export, enhanced security, and more 
    • Requires a valid license key 

    Installation in ag grid angular 

    1. Install the ag-grid-angular package from npm
      This installs the community version (free version)
      npm install ag-grid-angular
    2. Install the ag-grid-enterprise package from npm
      This installs the enterprise version (paid version)
      npm install ag-grid-enterprise

       

    Registering  Modules 

    AG-Grid uses modular architecture. To use the community features, import and register the community modules like this: 

    import { AllCommunityModule, ModuleRegistry } from 'ag-grid-community'; 
    
    // Register all community modules  
    ModuleRegistry.registerModules([AllCommunityModule])

    For enterprise features, you first need to register the enterprise modules.For enterprise features, you need to first register the enterprise modules. In addition, you must set your license key to activate these features properly. Moreover, it is essential to ensure both steps are completed to achieve full functionality. Therefore, following these steps carefully will help avoid any issues.

    import { LicenseManager } from 'ag-grid-enterprise';  
    import { AllEnterpriseModule } from 'ag-grid-enterprise';  
    
    //add license key
    LicenseManager.setLicenseKey('your-ag-grid-license-key');  
    
    // Register all enterprise modules  
    ModuleRegistry.registerModules([AllEnterpriseModule]);

    Note: Register the modules in the main.ts  file (the file where bootstrap is defined). 

    Creating Basic Grid 

    In your app.module.ts file, import AgGridModule from the @ag-grid-community/angular package. This module enables the use of AG Grid components in your Angular application. Once imported, you can easily configure and use AG Grid features throughout your app module.

    import { NgModule } from '@angular/core';  
    import { BrowserModule } from '@angular/platform-browser';  
    import { AppComponent } from './app.component';  
    import { AgGridModule } from '@ag-grid-community/angular';  
    
    @NgModule({  
      imports: [  
        BrowserModule,  
        AgGridModule,  
      ],  
      declarations: [AppComponent],  
      bootstrap: [AppComponent],  
    })  
    
    export class AppModule {}

    In app.component.html, add ag-grid-angular tag with required parameters 

    <ag-grid-angular 
      #agGrid 
      class="ag-theme-balham"
      style="width: 615px; height: 165px;" 
      [rowData]="rowData" 
      [columnDefs]="columnDefs"
    ></ag-grid-angular>

    In app.component.ts file, define the parameters for ag grid 

    import { Component } from '@angular/core'; 
    import { AgGridAngular } from '@ag-grid-community/angular'; 
    
    @Component({ 
      selector: 'my-app', 
      templateUrl: './app.component.html', 
      styleUrls: ['./app.component.css'], 
    }) 
    
    export class AppComponent { 
      columnDefs = [ 
        { 
          headerName: 'Employee ID', 
          field: 'emp_id', 
          sortable: true, 
          filter: true, 
        }, 
        { 
          headerName: 'Designation', 
          field: 'designation', 
        }, 
        { 
          headerName: 'Joining Year', 
          field: 'joining_year', 
        }, 
      ]; 
     
      rowData = [ 
          { 
            emp_id: 'EMP01', 
            designation: 'STC', 
            joining_year: 2020, 
          }, 
          { 
            emp_id: 'EMP02', 
            designation: 'TC', 
            joining_year: 2022, 
          }, 
          { 
            emp_id: 'EMP03', 
            designation: 'TC', 
            joining_year: 2022, 
          }, 
        ]; 
    }

    Make sure to register ag-grid module in main.ts. 

    import { bootstrapApplication } from '@angular/platform-browser'; 
    import { appConfig } from './app/app.config'; 
    import { App } from './app/app'; 
    import { AllCommunityModule, ModuleRegistry } from 'ag-grid-community';  
     
    // Register all community modules     
    ModuleRegistry.registerModules([AllCommunityModule]); 
    
    bootstrapApplication(App, appConfig) 
      .catch((err) => console.error(err));

    Add theme in style.css(global css file) 
    import it from ag-grid-community package

    /* Add application styles & imports to this file! */
    @import "~@ag-grid-community/all-modules/dist/styles/ag-grid.css";
    @import "~@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css";
    Screenshot 2025 07 16 204409

    ag-grid view

    The output of the above screen would show the grid. You can also try adding features and themes provided by ag-grid.

    Reference:Ag Grid Angular 

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleHoneypot Fields in Sitecore Forms
    Next Article How to Use AI Effectively in Your Dev Projects

    Related Posts

    Development

    Leading the QA Charge: Multi-Agent Systems Redefining Automation

    September 9, 2025
    Development

    Stop Duct-Taping AI Agents Together: Meet SmythOS

    September 9, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Microsoft Discloses Exchange Server Flaw Enabling Silent Cloud Access in Hybrid Setups

    Development

    CVE-2025-9792 – iSourcecode Apartment Management System SQL Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-44861 – TOTOLINK CA300-POE Command Injection

    Common Vulnerabilities and Exposures (CVEs)

    My top Xbox Game Pass title recommendations of 2025 — 7 games added this year you need to play

    News & Updates

    Highlights

    Distribution Release: MODICIA O.S. 6.12.41

    August 28, 2025

    The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. Marco M. Mariani has announced the availability of a major update of MODICIA O.S., a Debian-based multimedia distribution designed primarily for musicians, graphic designers and video makers. This is the project’s first build based on the recently-released Debian 13: “The new MODICIA O.S. 6.12.41, code-named ‘Caravaggio’, marks a….

    Xbox introduces limited Witcher 3 10th anniversary controllers, and they’re available right now

    May 22, 2025

    Facteur is mail-merge software

    May 4, 2025

    Google Can Keep Paying for Firefox Search Deal, Judge Rules

    September 2, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.