ComponentOne Grid for WPF: Grid for WPF Task-Based Help > Controlling Grid Interaction > Preventing a Column from Being Grouped

Preventing a Column from Being Grouped

You can prevent users from grouping particular columns at run time by using the AllowGroupBy property. By default the AllowGroupBy property is set to True and users can group columns. By setting the AllowGroupBy property to False you can prevent users from grouping particular columns in a grid.

In XAML

Prevent users from grouping the ProductName column at run time by adding AllowGroupBy="False" to the <c1grid:Column> tag so that it looks similar to the following:

<c1grid:Column PropertyName="ProductName" Caption="Name" AllowGroupBy="False"/>

In Code

Prevent users from grouping the ProductName column at run time by adding the following code to your project:

      Visual Basic

C1DataGrid1.Columns("ProductName").AllowGroupBy = False

      C#

c1DataGrid1.Columns["ProductName"].AllowGroupBy = false;


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