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

Preventing a Column from Being Filtered

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

In XAML

Set the AllowFilter property to False and prevent users from filtering the ProductName column at run time by adding AllowFilter="False" to the <c1grid:Column> tag so that it looks similar to the following:

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

In Code

Set the AllowFilter property to False and prevent users from filtering the ProductName column at run time by adding the following code to your project:

      Visual Basic

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

      C#

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


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