Infragistics(R) IgniteUI
Enabling Column Moving (igGrid)
E-mail your feedback on this topic.

Glossary Item Box

Topic Overview

Purpose

This topic explains, with code examples, how to enable the Column Moving feature of the igGrid™.

Required background

The following topics are prerequisites to understanding this topic:

Topic

Purpose

This topic explains conceptually the Column Moving feature of the igGrid, and the functionalities this feature provides.


In this topic


Column Moving – Conceptual Overview

Column Moving summary

The igGrid does not support column moving by default, so you need to enable it explicitly. This is done differently in JavaScript and ASP.NET MVC.

To enable Column Moving in…

Do this…

JavaScript

Define the Column Moving configuration in the grid’s features array.

ASP.NET MVC

Instantiate the Column Moving feature in the delegate passed to the Features method of the grid.



Column Moving – Code Examples

Code examples summary

The following table lists the code examples included in this topic.

Example

Description

This example demonstrates enabling the igGrid’s Column Moving feature with default configuration in JavaScript.

This example demonstrates enabling the igGrid Column Moving feature with default configuration in ASP.NET MVC.



Enabling Column Moving in JavaScript (Code Example)

Description

The following code creates an igGrid instance bound to the Products table data from the AdventureWorks database. The columns are auto-generated. Column Moving is enabled with its default configuration.

Code

In JavaScript:

$("#grid1").igGrid({
    dataSource: adventureWorks,
    autoGenerateColumns: true,
    features: [
        {
            name: "ColumnMoving"
        }
    ]
});

Enabling Column Moving in ASP.NET MVC (Code Example)

Description

The following code creates igGrid instance bound to a custom Product object collection defined as a View model. The columns are auto-generated. Column Moving s enabled with its default configuration.

Code

In C#:

Code
@model IQueryable<Sample.Models.Product>
@(Html.Infragistics()
    .Grid(Model)
    .AutoGenerateColumns(true)
    .Features(feature =>
    {
        feature.ColumnMoving();
    })
    .DataBind()
    .Render())

Related Content

Topics

The following topics provide additional information related to this topic.

Topic

Purpose

This topic explains, with code examples, how to configure the Column Moving feature of the igGrid.

This topic explains how to move columns in code using the Column Moving feature API.

This topic provides reference information on some of the properties of the Column Moving feature API of the igGrid.


Samples

The following samples provide additional information related to this topic.

Sample

Purpose

This sample demonstrates configuring column moving in the igGrid.

This sample demonstrates the API of the igGrid Column Moving feature.