Version

We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.

Column Moving

Another feature of the xamGrid™ control is column moving. Movable columns give users the freedom to arrange the columns of xamGrid in a way that they feel most comfortable working with it.

You can customize this feature so that your end users can do either of the following:

  • move columns by dragging the column across with a preview

  • move columns immediately to the new position.

By default column moving is not enabled on your xamGrid™. To enable column moving, you simply set the ColumnMovingSettings object’s AllowColumnMoving to one of the following values of the ColumnMovingType enumeration:

  • Indicator – This value specifies that column moving is enabled, and when your end user drags a column to a new position a preview will be shown.

  • Immediate – This value specifies that column moving is enabled, and when your end user drags a column to a new position it will move there immediately.

  • Disabled – This value turns off column moving.

The following code demonstrates how to enable column moving.

In XAML:

<ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False">
   <ig:XamGrid.ColumnMovingSettings>
      <ig:ColumnMovingSettings AllowColumnMoving="Indicator"/>
   </ig:XamGrid.ColumnMovingSettings>
   …
</ig:XamGrid>

In Visual Basic:

Imports Infragistics.Controls.Grids
...
Me.MyGrid.ColumnMovingSettings.AllowColumnMoving = ColumnMovingType.Indicator

In C#:

using Infragistics.Controls.Grids;
...
this.MyGrid.ColumnMovingSettings.AllowColumnMoving = ColumnMovingType.Indicator;

The following screen shot shows xamGrid with column moving enabled.

Column Moving