| Visual Basic (Declaration) | |
|---|---|
Public Property CalculateDistinctValues As Boolean | |
| C# | |
|---|---|
public bool CalculateDistinctValues {get; set;} | |
Return Value
true if distinct values are to be calculated; false otherwise. By default (if automatic filtering is enabled), true.All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise.
The following example demonstrates how to enable automatic filtering, disabling it for the columns that will not support it and filtering the distinct values of the ShipCity column.
| XAML | Copy Code |
|---|---|
<Grid> | |
If a column does not need to support automatic filtering, it is recommended to set its corresponding DataGridItemProperty's CalculateDistinctValues or the DataGridCollectionViewSource's DefaultCalculateDistinctValues properties to false.
Supported Frameworks: Microsoft .NET Framework version 3.5
Copy Code