<ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False"> <ig:XamGrid.ColumnMovingSettings> <ig:ColumnMovingSettings AllowColumnMoving="Indicator"/> </ig:XamGrid.ColumnMovingSettings> … </ig:XamGrid>
Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. For help or questions on migrating your codebase to the XamDataGrid, please contact support.
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.