DataGrid

The DataGrid is a widget that represents data from a local or remote source in the form of a grid. This widget offers such basic features as sorting, grouping, filtering, as well as more advanced capabilities, like state storing, export to Excel, master-detail interface, and many others.

Included in: dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/data_grid
Export: default
DataGrid interactive configuration
Copy Code
Copy to Codepen
$("#datagrid").dxDataGrid({
});

You can create the widget using one of the following approaches.

  • jQuery

    HTML
    <div id="dataGrid"></div>
    JavaScript
    $(function () {
        $("#dataGrid").dxDataGrid({
            dataSource: customers,
            columns: ['CompanyName', 'City', 'State', 'Phone', 'Fax']
        });
    });
  • AngularJS

    HTML
    <div ng-controller="DemoController">
        <div dx-data-grid="{
            dataSource: customers,
            columns: ['CompanyName', 'City', 'State', 'Phone', 'Fax']
        }"></div>
    </div>
    JavaScript
    angular.module('DemoApp', ['dx'])
        .controller("DemoController", function ($scope) {
            $scope.customers = [
                // ...   
            ];
        });
  • Knockout

    HTML
    <div data-bind="dxDataGrid: {
        dataSource: customers,
        columns: ['CompanyName', 'City', 'State', 'Phone', 'Fax']
    }"></div>
    JavaScript
    var viewModel = {
        customers: [
            // ...
        ]
    };
    ko.applyBindings(viewModel);
  • ASP.NET MVC Wrappers

    @(Html.DevExtreme().DataGrid()
        .ID("dataGrid")
        .DataSource(Customers)
        .Columns(columns => {
            columns.Add().DataField("CompanyName");
            columns.Add().DataField("City");
            columns.Add().DataField("State");
            columns.Add().DataField("Phone");
            columns.Add().DataField("Fax");
        })
    )

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

See Also

Start Tutorial View Demo Watch Video

Configuration

This section describes the configuration options of the DataGrid widget.

Methods

This section describes the methods that can be used to manipulate the DataGrid widget.

Events

This section describes events fired by this widget.

Row

This section describes the properties of a grid row. An object containing these properties comes to certain event-handling functions.