public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem) { Grid cellGrid = cell.Content as Grid; TextBlock primaryText = new TextBlock(){ TextAlignment = System.Windows.TextAlignment.Right }; TextBlock compareText = new TextBlock() { TextAlignment = System.Windows.TextAlignment.Right, Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100))}; if (string.IsNullOrEmpty(this.DataMemberBinding.StringFormat)) { this.ComparedPlanBinding.StringFormat = this.DataFormatString; this.DataMemberBinding.StringFormat = this.DataFormatString; } primaryText.SetBinding(TextBlock.TextProperty, this.DataMemberBinding); compareText.SetBinding(TextBlock.TextProperty, ComparedPlanBinding); if (cellGrid == null) { cellGrid = new Grid(); cellGrid.ColumnDefinitions.Add(new ColumnDefinition()); cellGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(20)}); cellGrid.ColumnDefinitions.Add(new ColumnDefinition()); cellGrid.RowDefinitions.Add(new RowDefinition()); cellGrid.Children.Add(primaryText); Grid.SetColumn(primaryText, 0); Grid.SetRow(primaryText, 0); cellGrid.Children.Add(compareText); Grid.SetColumn(compareText, 2); Grid.SetRow(compareText, 0); } return cellGrid; }public class MyDataSource : ChartDataSource{ public MyDataSource() : base() { this.ValueAggregateFunction = new SumFunction(); }}Hello, I was wondering how to change and/or remove the "root" composite filter in the RadDataFilter. I am loading filters programmatically and I need to change the default "And" to an "Or". If this is not possible, than I just need to remove this root filter and add my own. Please see the code below as well as the attached screen shot. I am using .NET 4.0 (full) and Telerik 2013 Q1. Thank you.
XAML:
<T:RadDataFilter x:Name="filtMain" AutoGenerateItemPropertyDefinitions="False" />
Code Behind:
filtMain.ItemPropertyDefinitions.Add(new ItemPropertyDefinition("FirstName", typeof(string), "First Name"));
filtMain.ItemPropertyDefinitions.Add(new ItemPropertyDefinition("MiddleName", typeof(string), "Middle Name"));
filtMain.ItemPropertyDefinitions.Add(new ItemPropertyDefinition("LastName", typeof(string), "Last Name"));
CompositeFilterDescriptor parent = new CompositeFilterDescriptor() { LogicalOperator = FilterCompositionLogicalOperator.Or };
parent.FilterDescriptors.Add(new FilterDescriptor("FirstName", FilterOperator.EndsWith, "an"));
parent.FilterDescriptors.Add(new FilterDescriptor("MiddleName", FilterOperator.IsEqualTo, "Bob"));
parent.FilterDescriptors.Add(new FilterDescriptor("LastName", FilterOperator.DoesNotContain, "Doe"));
// FilterDescriptors is empty. Where is the root "And" composite that I see on the screen???
filtMain.FilterDescriptors.Add(parent);