This is a migrated thread and some comments may be shown as answers.

Standard Contains Filter instead of IsEqualTo

2 Answers 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin Hendriks
Top achievements
Rank 1
Kevin Hendriks asked on 15 Nov 2011, 02:20 PM
Is it possible to set the Filter to COntains standard instead of IsEqualTo.

I tried the following 
<telerikData:FilterDescriptor Member="Country"
                             
Operator="Contains" />

But when I then open the filter menu it is back in IsEqualTo

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 16 Nov 2011, 08:55 AM
Hi Kevin Hendriks,

 For the Q3 2011 version of the RadControls there is a new event of the RadGridView introduced - FilterOperatorsLoading. When subscribed to it, you could set the default operator of the filtering control. 

private void clubsGrid_FilterOperatorsLoading(object sender, Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs e)
{
    e.DefaultOperator = FilterOperator.Contains;
}

Furthermore you could change the list of the available filter operators.

I believe that this is what you need.

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
smith
Top achievements
Rank 1
answered on 17 Feb 2012, 10:35 AM
HI 

  I am not using the Filtering Controlevent. extended  the 
FilteringControl pls see my below code
  public CustomizedFilteringControl(GridViewColumn column)
            : base(column)
        {
            this.Loaded += new RoutedEventHandler(CustomizedFilteringControl_Loaded); ;
        }
        void CustomizedFilteringControl_Loaded(object sender, RoutedEventArgs e)
        {
            StyleManager.SetThemeFromParent(thisthis.ParentOfType<RadGridView>());
        }
        public override void Prepare(GridViewColumn column)
        {

            base.Prepare(column);
            var cbo1 = this.ChildrenOfType<RadComboBox>().Where(b => b.Name == "PART_Filter1ComboBox").FirstOrDefault();
            cbo1.SelectedValue = FilterOperator.StartsWith;

            var cbo2 = this.ChildrenOfType<RadComboBox>().Where(b => b.Name == "PART_Filter2ComboBox").FirstOrDefault();
            cbo2.SelectedValue = FilterOperator.EndsWith;
        }

In XAML inside gridview Settting like
 <telerik:GridViewDataColumn Header="Aircraft" UniqueName="Aircraft" DataMemberBinding="{Binding Path=Aircraft,Mode=TwoWay,Converter={StaticResource TrimConverter}}" IsReadOnly="True">
                                    <telerik:GridViewDataColumn.FilteringControl>
                                        <fc:CustomizedFilteringControl></fc:CustomizedFilteringControl>
                                    </telerik:GridViewDataColumn.FilteringControl>
                                </telerik:GridViewDataColumn>


i cant change all the colums in each gridview nad all pages. so pls provide me the minimal change solution.
regards
murugan.
Tags
GridView
Asked by
Kevin Hendriks
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
smith
Top achievements
Rank 1
Share this question
or