New to Telerik UI for WinUI? Download free 30-day trial

NumericalFilterDescriptor

Represents a descriptor which filters by property of a numerical type.

Properties

  • PropertyName: Gets or sets the name of the property that is used to retrieve the value to filter by.
  • Value: Gets or sets the value used in the comparisons. This is the right operand of the comparison.
  • Operator: Gets or sets the NumericalOperator value that defines the boolean logic behind the left and right operand comparison.

Adding a NumericalFilterDescriptor

Example 1 demonstrates how to leave only the objects, whose CityPopulation property is less than 20 000.

Example 1: Adding the RadDataGrid in xaml

<Grid xmlns:grid="using:Telerik.UI.Xaml.Controls.Grid" 
     xmlns:dataCore="using:Telerik.Data.Core"> 
    <grid:RadDataGrid x:Name="grid" VerticalAlignment="Center"> 
        <grid:RadDataGrid.FilterDescriptors> 
            <dataCore:NumericalFilterDescriptor PropertyName="CityPopulation" 
                                               Operator="IsLessThan" 
                                               Value="20000"/> 
        </grid:RadDataGrid.FilterDescriptors> 
    </grid:RadDataGrid> 
</Grid> 

Example 2: Populating the RadDataGrid

public sealed partial class MainPage : Page 
{ 
    public MainPage() 
    { 
        this.InitializeComponent(); 
 
        List<CustomData> data = new List<CustomData> 
        { 
            new CustomData { Country = "Brazil", City = "Caxias do Sul", CityPopulation = 450000 }, 
            new CustomData { Country = "Brazil", City = "Fortaleza", CityPopulation = 2500000 }, 
            new CustomData { Country = "Spain", City = "Malaga", CityPopulation = 569000 }, 
            new CustomData { Country = "Bulgaria", City = "Koynare", CityPopulation = 5000 }, 
            new CustomData { Country = "Spain", City = "Valencia", CityPopulation = 810000 }, 
            new CustomData { Country = "Ghana", City = "Kade", CityPopulation = 16000 }, 
            new CustomData { Country = "Brazil", City = "Porto Alegre", CityPopulation = 1510000 }, 
            new CustomData { Country = "Bulgaria", City = "Byala Slatina", CityPopulation = 11000 }, 
            new CustomData { Country = "Brazil", City = "Joinville", CityPopulation = 515000 }, 
        }; 
        this.grid.ItemsSource = data; 
    } 
} 
 
public class CustomData 
{ 
    public string Country { get; set; } 
 
    public string City { get; set; } 
 
    public double CityPopulation { get; set; } 
} 

Figure 1: RadDataGrid after filtering

NumericalFilterDescriptor example

See Also

In this article
Not finding the help you need?