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

      Designing Better UX For Left-Handed People

      July 25, 2025

      This week in AI dev tools: Gemini 2.5 Flash-Lite, GitLab Duo Agent Platform beta, and more (July 25, 2025)

      July 25, 2025

      Tenable updates Vulnerability Priority Rating scoring method to flag fewer vulnerabilities as critical

      July 24, 2025

      Google adds updated workspace templates in Firebase Studio that leverage new Agent mode

      July 24, 2025

      Trump’s AI plan says a lot about open source – but here’s what it leaves out

      July 25, 2025

      Google’s new Search mode puts classic results back on top – how to access it

      July 25, 2025

      These AR swim goggles I tested have all the relevant metrics (and no subscription)

      July 25, 2025

      Google’s new AI tool Opal turns prompts into apps, no coding required

      July 25, 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

      Laravel Scoped Route Binding for Nested Resource Management

      July 25, 2025
      Recent

      Laravel Scoped Route Binding for Nested Resource Management

      July 25, 2025

      Add Reactions Functionality to Your App With Laravel Reactions

      July 25, 2025

      saasykit/laravel-open-graphy

      July 25, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Sam Altman won’t trust ChatGPT with his “medical fate” unless a doctor is involved — “Maybe I’m a dinosaur here”

      July 25, 2025
      Recent

      Sam Altman won’t trust ChatGPT with his “medical fate” unless a doctor is involved — “Maybe I’m a dinosaur here”

      July 25, 2025

      “It deleted our production database without permission”: Bill Gates called it — coding is too complex to replace software engineers with AI

      July 25, 2025

      Top 6 new features and changes coming to Windows 11 in August 2025 — from AI agents to redesigned BSOD screens

      July 25, 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

    Laravel Scoped Route Binding for Nested Resource Management

    July 25, 2025
    Development

    Add Reactions Functionality to Your App With Laravel Reactions

    July 25, 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

    10-Year-Old Roundcube RCE Vulnerability Let Attackers Execute Malicious Code

    Security

    CVE-2025-38001 – Linux Kernel Netem HFSC Double Insertion Uninitialized Use After Free

    Common Vulnerabilities and Exposures (CVEs)

    Ensuring Attribute Consistency in Laravel Relationship Creations

    Development

    CVE-2025-40582 – Siemens SCALANCE LPE9403 Command Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-36116 – IBM Db2 Mirror for i Cross-Site WebSocket Hijacking Vulnerability

    July 23, 2025

    CVE ID : CVE-2025-36116

    Published : July 23, 2025, 3:15 p.m. | 7 hours, 50 minutes ago

    Description : IBM Db2 Mirror for i 7.4, 7.5, and 7.6 GUI is affected by cross-site WebSocket hijacking vulnerability. By sending a specially crafted request, an unauthenticated malicious actor could exploit this vulnerability to sniff an existing WebSocket connection to then remotely perform operations that the user is not allowed to perform.

    Severity: 6.3 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-5990 – Crafty Controller Stored XSS Vulnerability

    June 15, 2025

    CVE-2025-39491 – WHMpress Path Traversal Vulnerability

    May 16, 2025

    CVE-2025-6650 – PDF-XChange Editor U3D File Parsing Out-Of-Bounds Read Information Disclosure

    June 25, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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