Hi there,
I've subclassed the FilteringControl in order to hook in to the OnApplyFilter() call. When I apply this filtering control to my column nothing happens when I click on the filter button in the column header. When I test it out using the parent FilteringControl class it works fine.
This is the Xaml...
This is the code behind...
Then this is the data generation code...
I'm running .Net 4.5 and Telerik 2015.1 noxaml binaries (although I've had the same issue with 2014.3 Telerik noxaml binaries too). I suspect I'm doing something wrong here as this basic action doesn't appear to be working for me.
Thanks in advance for your help.
Russell
I've subclassed the FilteringControl in order to hook in to the OnApplyFilter() call. When I apply this filtering control to my column nothing happens when I click on the filter button in the column header. When I test it out using the parent FilteringControl class it works fine.
This is the Xaml...
<Window x:Class="TestTelerikGrid.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:testTelerikGrid="clr-namespace:TestTelerikGrid" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/System.Windows.xaml"/> <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.xaml"/> <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/> <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.GridView.xaml"/> <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml"/> <ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Data.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid> <telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding FirstName}"> <telerik:GridViewDataColumn.FilteringControl> <testTelerikGrid:BasicFilteringControl /> </telerik:GridViewDataColumn.FilteringControl> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid></Window>This is the code behind...
using System.Windows;using Telerik.Windows.Controls.GridView;namespace TestTelerikGrid{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); radGridView.ItemsSource = EmployeeService.GetEmployees(); } } public class BasicFilteringControl : FilteringControl { }}Then this is the data generation code...
using System.Collections.ObjectModel;namespace TestTelerikGrid{ public class Employee { public string FirstName { get; set; } public string LastName { get; set; } public int Age { get; set; } public bool IsMarried { get; set; } } public class EmployeeService { public static ObservableCollection<Employee> GetEmployees() { ObservableCollection<Employee> employees = new ObservableCollection<Employee>(); Employee employee = new Employee(); employee.FirstName = "Maria"; employee.LastName = "Anders"; employee.IsMarried = true; employee.Age = 24; employees.Add(employee); employee = new Employee(); employee.FirstName = "Ana"; employee.LastName = "Trujillo"; employee.IsMarried = true; employee.Age = 44; employees.Add(employee); employee = new Employee(); employee.FirstName = "Antonio"; employee.LastName = "Moreno"; employee.IsMarried = true; employee.Age = 33; employees.Add(employee); employee = new Employee(); employee.FirstName = "Thomas"; employee.LastName = "Hardy"; employee.IsMarried = false; employee.Age = 13; employees.Add(employee); employee = new Employee(); employee.FirstName = "Hanna"; employee.LastName = "Moos"; employee.IsMarried = false; employee.Age = 28; employees.Add(employee); employee = new Employee(); employee.FirstName = "Frederique"; employee.LastName = "Citeaux"; employee.IsMarried = true; employee.Age = 67; employees.Add(employee); employee = new Employee(); employee.FirstName = "Martin"; employee.LastName = "Sommer"; employee.IsMarried = false; employee.Age = 22; employees.Add(employee); employee = new Employee(); employee.FirstName = "Laurence"; employee.LastName = "Lebihan"; employee.IsMarried = false; employee.Age = 32; employees.Add(employee); employee = new Employee(); employee.FirstName = "Elizabeth"; employee.LastName = "Lincoln"; employee.IsMarried = false; employee.Age = 9; employees.Add(employee); employee = new Employee(); employee.FirstName = "Victoria"; employee.LastName = "Ashworth"; employee.IsMarried = true; employee.Age = 29; employees.Add(employee); return employees; } }}I'm running .Net 4.5 and Telerik 2015.1 noxaml binaries (although I've had the same issue with 2014.3 Telerik noxaml binaries too). I suspect I'm doing something wrong here as this basic action doesn't appear to be working for me.
Thanks in advance for your help.
Russell