ComponentOne Grid for WPF: Grid for WPF Task-Based Help > Controlling Grid Interaction > Preventing the Grid from Being Reordered

Preventing the Grid from Being Reordered

ComponentOne Grid for WPF allows users to easily reorder columns through a drag-and-drop operation. You can easily prevent all columns in a grid from being reordered by using the AllowColumnMove property. By default the AllowColumnMove property is set to True and reordering columns is allowed. By setting the AllowColumnMove property False, you can prevent users from reordering columns in the grid.

In XAML

Prevent users from reordering the grid at run time by adding AllowColumnMove="False" to the <c1grid:C1DataGrid> tag so that it looks similar to the following:

<c1grid:C1DataGrid Name="C1DataGrid1" AllowColumnMove="False"/>

In Code

Prevent users from reordering grid at run time by adding the following code to your project:

      Visual Basic

C1DataGrid1.AllowColumnMove = False

      C#

c1DataGrid1.AllowColumnMove = false;

At Design Time

Prevent users from reordering the grid at run time by setting the AllowColumnMove property False in the C1DataGrid's Properties window.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.