Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy

Hi, In our application Many IgGrids are used. But we want maintain and Controlled some of IgGrid Properties From Centralized place.

For  Example : 

Vartualization property Should be true for all the developed grids. If any one is  Creating new grid this property should be True.

Like some of the other properties too should be controlled.

AutoGenerateColumns, VirtualizationMode.

Is there any way to handle this or any workaround.

We are creating grids in the Razor view like below

.Columns(col =>
col.For(x => x.Id).HeaderText("Number").DataType("number").Width("6%").Template("<td actionRootId=${Id} actionTypeId='2' Class='contextCss'>${Id}</td>").GetType();

col.For(x => x.Owner).HeaderText("Owner").Width("10%").Template("<td actionRootId=${Id} actionTypeId='2' class='contextCss'>${Owner}</td>");

col.For(x => x.StatusFormatted).HeaderText("Status").Width("6%").Template("<td actionRootId=${Id} actionTypeId='2' class='contextCss'>${StatusFormatted}</td>");

features =>
.DataSourceUrl(Url.Action("GetItemsData", "View", new { Id = Model.Id}))


  • 345
    Offline posted

    Hello Ram p,


    Thank you for posting in our forum.


    A possible approach would be to override the igGrid object's prototype on the client side – this would allow you to set default values to the options you mentioned. These options would apply for every igGrid that gets initialized afterwards. There are two important things to note here:

    1. The modification of the igGrid prototype should happen after the infragistics.core.js and infragistics.lob.js scripts have been loaded in the browser, but before the grids have been initialized. Otherwise you would: a) Get an error for trying to modify properties of an object that doesn’t exist yet; b) you would modify the properties of the prototype but the grids would have already been initialized and the changes would not have any effect.
    2. Modifying the prototype would allow you to set default grid options, but doesn’t prevent each grid to override them again upon its initialization – any explicitly set initialization options would take precedence because of the JavaScript’s prototypal inheritance. For example the autoCommit option is disabled for the igGrid by default – meaning its value is “false. The prototype could be modified by using this code: $.ui.igGrid.prototype.options.autoCommit = true; If autoCommit is again set to “false in the grid initialization options, it would take precedence and the grid would still have autoCommit disabled.

    Here is a snippet from a sample View file so that you get a better idea of where to override the igGrid prototype:


    <!DOCTYPE html>
        <meta name="viewport" content="width=device-width" />
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>
        <link href="" rel="stylesheet" />
        <link href="" rel="stylesheet" />
            $.ui.igGrid.prototype.options.autoCommit = true;
            $.ui.igGrid.prototype.options.virtualization = true;
            $.ui.igGrid.prototype.options.virtualizationMode = "continuous";
            .Columns(column =>
                column.For(x => x.ProductID).HeaderText("Id").Width("20%");
                column.For(x => x.ProductName).HeaderText("Name").Width("50%");
                column.For(x => x.StartDate).HeaderText("Date").DataType("date").Width("30%");
            .Features(features =>
                features.Updating().ColumnSettings(cs =>
                    cs.ColumnSetting().ColumnKey("StartDate").EditorType(ColumnEditorType.DatePicker).Required(true).EditorOptions("datepickerOptions: {changeYear: true, changeMonth: true}");


    If you need any additional assistance, feel free to contact me.