How to fix filter dropdown width?

22 posts, 2 answers
  1. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 08 Jul 2010 Link to this post

    Hi Support,

    In my grid view I am displaying a large strings in one column, SO when user tries to filter it,Filter Drop down almost covering the whole grid width, SO i just want to fix filter drop down width, with a horizontal scroll bar. I tried the below code, but it actually fixing width of column header .
    And another important thing is that i want do it in loading time only.

    foreach (GridViewHeaderCell hc in gvData.ChildrenOfType<GridViewHeaderCell>())
               {
                   if (hc.Column.UniqueName == "ATU")
                   {
                       var fdd = hc.ChildrenOfType<FilteringDropDown>()[0];
                       //.
                       MessageBox.Show(fdd.ActualWidth.ToString());
                       fdd.Width = 15;
                   }
     
               }
    Thanks...
  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 08 Jul 2010 Link to this post

    Hello Kevin Tran,

     You can get the control that displays the distinct values like so:

    foreach (GridViewHeaderCell hc in gvData.ChildrenOfType<GridViewHeaderCell>())
               {
                   if (hc.Column.UniqueName == "ATU")
                   {
                       var fdd = hc.ChildrenOfType<FilteringDropDown>()[0];
     
                       var distinctList = fdd.ChildrenOfType<ListBox>().Where((l) => l.Name == "PART_DistinctValuesList").FirstOrDefault();
                   }
               }

    You can modify it as you see fit.

    Sincerely yours,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Hi Yavor Georgiev,
    Thanks for the answer, But unfortunately its not working for me, I am unable to find control. 
    foreach (GridViewHeaderCell hc in gvData.ChildrenOfType<GridViewHeaderCell>())
               {
                   if (hc.Column.UniqueName == "ATU")
                   {
                       var fdd = hc.ChildrenOfType<FilteringDropDown>()[0];
                       var distinctList = fdd.ChildrenOfType<Telerik.Windows.Controls.ListBox>().Where((l) => l.Name == "PART_DistinctValuesList").FirstOrDefault();
                       distinctList.Width = 100;
                       //.
                       MessageBox.Show(fdd.ActualWidth.ToString());
                       //fdd.Width = 15;
                   }
     
               }
           }

    In which i am getting   fdd.ChildrenOfType<Telerik.Windows.Controls.ListBox>() count as zero,
    I want to fix filterdrop down while items loading to grid.Is there any way ? Is it possible?
    Thanks,
    Kevin



  5. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Jul 2010 Link to this post

    Hello Kevin Tran,

     Try with this code instead:

    var fdd = cell.FindChildByType<FilteringDropDown>();
    var popup = cell.FindChildByType<Popup>();
    popup.Opened += (o, args) =>
        {
            var box = popup.Child.ChildrenOfType<ListBox>().Where((c) => c.Name == "PART_DistinctValuesList").FirstOrDefault();
            box.Width = 200;
        };

    Regards,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Hey i am not getting popup.opened event, Is there any name space i need to include, 
  7. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Jul 2010 Link to this post

    Hi Kevin Tran,

     You can find the Popup class in the System.Windows.Controls.Primitives namespace.

    Sincerely yours,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Ofcourse i included that name space , but i am not getting popup.opened event.

    Thanks
  9. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Jul 2010 Link to this post

    Hi Kevin Tran,

     You should be getting it - it's in MSDN. Can you verify that the popup object is of type Telerik.Windows.Controls.Primitives.Popup?

    Sincerely yours,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Thanks for your patience 
    But here is my error
    1. 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' does not contain a definition for 'Opened' and no extension method 'Opened' accepting a first argument of type 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' could be found (are you missing a using directive or an assembly reference?)
    2. 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' does not contain a definition for 'Child' and no extension method 'Child' accepting a first argument of type 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' could be found (are you missing a using directive or an assembly reference?)

    Thanks,
  11. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Thanks for your patience 
    But here is my error
    1. 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' does not contain a definition for 'Opened' and no extension method 'Opened' accepting a first argument of type 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' could be found (are you missing a using directive or an assembly reference?)
    2. 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' does not contain a definition for 'Child' and no extension method 'Child' accepting a first argument of type 'System.Collections.Generic.IList<System.Windows.Controls.Primitives.Popup>' could be found (are you missing a using directive or an assembly reference?)


    Thanks,
  12. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Jul 2010 Link to this post

    Hello Kevin Tran,

     Are you using the FindChildByType method like I do in the snippet I posted, or are you using ChildrenOfType? FindChildByType returns the first element it finds, whereas ChildrenOfType returns a collection, from which you'd need to extract the first item by calling the FirstOrDefault extension method on it.

    Best wishes,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Sorry i forgot to tell you when i am using FindchildBytype, I got this error 

    'Telerik.Windows.Controls.GridView.GridViewHeaderCell' does not contain a definition for 'FindChildByType' and no extension method 'FindChildByType' accepting a first argument of type 'Telerik.Windows.Controls.GridView.GridViewHeaderCell' could be found (are you missing a using directive or an assembly reference?)

    I am using 10.1.6.3 version Q1 2010 SP2 version
  14. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Jul 2010 Link to this post

    Hello Kevin Tran,

     The FindChildByType extension method is defined in the Telerik.Windows.Controls namespace. Be sure to include that.

    All the best,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  15. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    private void fixfilterwidth()
          {
              foreach (GridViewHeaderCell hc in gvData.ChildrenOfType<GridViewHeaderCell>())
              {
                  if (hc.Column.UniqueName == "ATU")
                  {
     
     
                      var fdd = hc.ChildrenOfType<FilteringDropDown>();
                      var popup = hc.ChildrenOfType<Popup>();
                   
                    
                      popup[0].Opened += (o, args) =>
                      {
                          var box = popup[0].Child.ChildrenOfType<Telerik.Windows.Controls.ListBox>().Where((c) => c.Name == "PART_DistinctValuesList").FirstOrDefault();
                          if(box!=null)
                          box.Width = 200;
                      };
                  }
     
              }
                  
          }
    No luck :(
  16. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    check this screen shot
  17. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Jul 2010 Link to this post

    Hello Kevin Tran,

     The C# compiler is case-sensitive and thus you must spell the method name correctly: FindChildByType.

    However, there is another, far easier way for you to achieve your requirement. In the resources of the XAML page containing your RadGridView, add the following style:

    <Style TargetType="telerik:FilteringControl">
        <Setter Property="MaxWidth" Value="220"/>
    </Style>

    Best wishes,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  18. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 09 Jul 2010 Link to this post

    Hi,
    I dont know what went wrong so here is my xaml. In which telerikGridView:FilteringControl not found
    <telerikGridView:RadGridView x:Name="gvData" IsFilteringAllowed="True" FontSize="8" Margin="0" VerticalAlignment="Top" SelectionMode="Multiple" AutoGenerateColumns="False" ShowColumnFooters="True" CanUserFreezeColumns="False" RowHeight="12" ShowGroupPanel="False" CanUserSortColumns="False" Padding="1" Filtering="gvData_Filtering">
                     <telerikGridView:RadGridView.Resources>
     
                         <Style TargetType="telerikGridView:FilteringControl">
                             <Setter Property="MaxWidth" Value="220"/>
                         </Style>
                          
                     </telerikGridView:RadGridView.Resources>
                     <telerikGridView:RadGridView.Columns>
                         <telerikGridView:GridViewSelectColumn  Header="ATU Name" FooterTextAlignment="Left" IsReorderable="False"  >
     
     
                         </telerikGridView:GridViewSelectColumn>
                         <telerikGridView:GridViewDataColumn  UniqueName="id" FooterTextAlignment="Left" IsReorderable="False"   DataMemberBinding="{Binding id}">
     
                         </telerikGridView:GridViewDataColumn>
     
                         <telerikGridView:GridViewDataColumn  Header="ATU Name" UniqueName="ATU" FooterTextAlignment="Left" IsReorderable="False"   Width="100" DataMemberBinding="{Binding Top_Parent }" >
                             <telerikGridView:GridViewDataColumn.CellTemplate>
                                 <DataTemplate>
     
                                     <TextBlock TextWrapping="Wrap" Text="{Binding Path=Top_Parent}" Margin="5"  TextAlignment="Left">
                                     </TextBlock>
     
                                 </DataTemplate>
                             </telerikGridView:GridViewDataColumn.CellTemplate>
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Top Parent"  IsReorderable="False"   DataMemberBinding="{Binding ATUname}">
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Opty Name"  IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Territory Name"  DataFormatString="{}{0:C0}" IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Forecast" FooterTextAlignment="Left" IsReorderable="False"  DataMemberBinding="{Binding Forecast}" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Actual"  IsReorderable="False"  DataMemberBinding="{Binding Actual}" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Variance"  IsReorderable="False"  DataMemberBinding="{Binding Variance}">
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Program"  DataFormatString="{}{0:C0}" IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
     
                         <telerikGridView:GridViewDataColumn Header="Sales Stage" FooterTextAlignment="Left" IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Status"  IsReorderable="False"  >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="New Opty Amt"  IsReorderable="False"   DataMemberBinding="{Binding New_Oppty_Amt}">
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Comments"  DataFormatString="{}{0:C0}" IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Escalation" FooterTextAlignment="Left" IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="Forecast Change"  IsReorderable="False"  DataMemberBinding="{Binding Forecast_Change}" >
     
                         </telerikGridView:GridViewDataColumn>
                         <telerikGridView:GridViewDataColumn Header="(CRM) Comments"  IsReorderable="False" >
     
                         </telerikGridView:GridViewDataColumn>
     
                     </telerikGridView:RadGridView.Columns>
                 </telerikGridView:RadGridView>
    and 
    var ex = hc.FindChildByType<FilteringDropDown>();
    error is 
    'Telerik.Windows.Controls.GridView.GridViewHeaderCell' does not contain a definition for 'FindChildByType' and no extension method 'FindChildByType' accepting a first argument of type 'Telerik.Windows.Controls.GridView.GridViewHeaderCell' could be found (are you missing a using directive or an assembly reference?)
    I am using vs2010, so i think it will give me intellisense if method exists.
  19. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 09 Jul 2010 Link to this post

    Hello Kevin Tran,

    Please, disregard completely everything else and take a look at the sample project that I have attached.

    Do not use the ChildrenOfType and FindChild methods. Delete them from your source-code completely.

    The sample project that I have attached does exactly what you want to achieve. It works. Examine it very carefully and use it. The rest of your XAML is your own responsibility.

    Here is what makes my sample project work. The thing in the yellow:

    <UserControl x:Class="FilteringControlMaxWidth.MainPage"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:my="clr-namespace:FilteringControlMaxWidth"
                 mc:Ignorable="d" d:DesignHeight="700" d:DesignWidth="700">
        <UserControl.Resources>
            <my:MyViewModel x:Key="MyViewModel"/>
             
            <!-- Here, this will make all filtering controls be 220 at most. -->
            <Style TargetType="telerik:FilteringControl">
                <Setter Property="MaxWidth" Value="220"/>
            </Style>
             
        </UserControl.Resources>
        <Grid x:Name="LayoutRoot"
              Background="White"
              DataContext="{StaticResource MyViewModel}">
            <telerik:RadGridView Name="clubsGrid"
                                 ItemsSource="{Binding Clubs}"
                                 AutoGenerateColumns="False"
                                 Margin="5">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Established}"
                                                Header="Est."
                                                DataFormatString="{}{0:yyyy}"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}"
                                                Header="Stadium"
                                                DataFormatString="{}{0:N0}"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </Grid>
    </UserControl>

    I really hope this helps.

    Greetings,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  20. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 14 Jul 2010 Link to this post

    To cut short it,

    import this name space     xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    then add this
    <UserControl.Resources>
          <!--<my:MyViewModel x:Key="MyViewModel"/>-->
     
          <!-- Here, this will make all filtering controls be 220 at most. -->
          <Style TargetType="telerik:FilteringControl">
              <Setter Property="MinWidth" Value="250"/>
              <Setter Property="MaxWidth" Value="250"/>
          </Style>
     
      </UserControl.Resources>


    Now my problem is that i am unable to apply theme here :( , Any suggestions 
  21. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 14 Jul 2010 Link to this post

    Hi Kevin Tran,

    Then I guess that you should edit the template of the filtering control.

    I have attached a sample project that has the FilteringControl template at its default state. From there on, you can change whatever you want in this template in order to tailor it to your needs. For example, look for the Style that targets the filtering control and add the Min and Max Width. I have done this for you, but I have left the lines commented out.

    In order to understand how styles and templates work in general, you can read this article.

    I hope this helps.

    Regards,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  22. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 17 Jul 2010 Link to this post

    Hi Support,
    Thanks for the response, I tried that code and i know it is do-able, My client liked windows 7 theme with filter drop down list width fixed.
    Is there any simple method to achieve this , rather than overriding each property.

    Thanks,
    Kevin
  23. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 19 Jul 2010 Link to this post

    Hi Kevin Tran,

    What do you mean by "each property"? In my sample I used the default theme and changed only 1 property. In you case you should take the Windows 7 template and use it instead of the default one. The simply change only what you want -- not each property. Change only the width.

    For your convenience I will paste the Windows 7 version of the XAML. Use it instead of the previous one.

                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
                         
                     
                     
                        xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
                        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"    
                        xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
                        xmlns:treelist="clr-namespace:Telerik.Windows.Controls.TreeListView;assembly=Telerik.Windows.Controls.GridView"
                        xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
                     
                 
        >
     
        <SolidColorBrush x:Key="ControlInnerBorder" Color="White" />
    <telerik:Windows7Theme x:Key="Theme" />
    <LinearGradientBrush x:Key="GridView_FilteringControlBackground" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFD2DEEE"/>
            <GradientStop Color="#FFEEF3FC" Offset="0.2"/>
        </LinearGradientBrush>
    <SolidColorBrush x:Key="GridView_FilteringControlOuterBorder" Color="#FFC0CBD9" />
    <SolidColorBrush x:Key="ControlForeground" Color="Black" />
     
         
        <grid:FilterOperatorConverter x:Key="FilterOperatorConverter" />
        <grid:FilterCompositionLogicalOperatorConverter x:Key="FilterCompositionLogicalOperatorConverter" />
     
        <DataTemplate x:Key="ActionTemplate">
            <TextBlock Text="{Binding Converter={StaticResource FilterOperatorConverter}}" />
        </DataTemplate>
     
        <DataTemplate x:Key="LogicalOperatorTemplate">
            <TextBlock Text="{Binding Converter={StaticResource FilterCompositionLogicalOperatorConverter}}" />
        </DataTemplate>
         
        <ControlTemplate x:Key="FilteringControlTemplate" TargetType="grid:FilteringControl">
            <Border BorderThickness="{TemplateBinding BorderThickness}"
                    Margin="{TemplateBinding Margin}"
                    CornerRadius="1"
                    BorderBrush="{TemplateBinding BorderBrush}">
                <Border BorderBrush="{StaticResource ControlInnerBorder}" BorderThickness="1" Background="{TemplateBinding Background}">
                    <StackPanel MinWidth="200" MaxWidth="350" Margin="{TemplateBinding Padding}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">                
                        <StackPanel x:Name="PART_DistinctFilter" Visibility="{TemplateBinding DistinctFiltersVisibility}">
                            <CheckBox x:Name="PART_SelectAllCheckBox"
                                      IsChecked="{Binding SelectAll, Mode=TwoWay}"
                                      Margin="0,2"
                                      telerik:LocalizationManager.ResourceKey="GridViewFilterSelectAll"
                                      telerik:StyleManager.Theme="{StaticResource Theme}"/>                    
                             
                            <ListBox x:Name="PART_DistinctValuesList"
                                     ItemsSource="{Binding DistinctValues}"
                                     telerik:StyleManager.Theme="{StaticResource Theme}"
                                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                     MaxHeight="250"
                                     SelectionMode="Multiple">
                                 
                                <ListBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel/>
                                    </ItemsPanelTemplate>
                                </ListBox.ItemsPanel>
                                 
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsActive, Mode=TwoWay}"
                                                  Content="{Binding ConvertedValue}"
                                                  VerticalContentAlignment="Center"
                                                  telerik:StyleManager.Theme="{StaticResource Theme}"/>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                                <!--<ListBox.ItemContainerStyle>
                                    <Style TargetType="ListBoxItem"
                                            
                                           telerik:StyleManager.BasedOn="{StaticResource Theme}"
                                            
                                            
                                           >
                                    </Style>
                                </ListBox.ItemContainerStyle>-->
                            </ListBox>
                        </StackPanel>
                        <StackPanel Margin="0,2">
                            <TextBlock telerik:LocalizationManager.ResourceKey="GridViewFilterShowRowsWithValueThat" Margin="0,2,0,0" />
                            <input:RadComboBox x:Name="PART_Filter1ComboBox"
                                               Margin="0,2,0,2"
                                               ItemTemplate="{StaticResource ActionTemplate}"
                                               telerik:StyleManager.Theme="{StaticResource Theme}"
                                               ItemsSource="{Binding AvailableActions}"
                                               SelectedItem="{Binding Filter1.Operator, Mode=TwoWay}" />
                            <TextBox x:Name="PART_Filter1TextBox"
                                     Text="{Binding Filter1.Value, Mode=TwoWay}"
                                     VerticalContentAlignment="Center"
                                     Margin="0,2" Padding="3,0"
                                     telerik:StyleManager.Theme="{StaticResource Theme}"
                                     Height="22" />
                            <CheckBox x:Name="PART_Filter1MatchCaseCheckBox"
                                      IsChecked="{Binding Filter1.IsCaseSensitive, Mode=TwoWay}"
                                      Visibility="{Binding MatchCaseVisibility}"
                                      Margin="0,2"
                                      telerik:LocalizationManager.ResourceKey="GridViewFilterMatchCase"
                                      telerik:StyleManager.Theme="{StaticResource Theme}"/>
                            <input:RadComboBox x:Name="PART_LogicalOperatorsComboBox"
                                               Margin="0,2"
                                               telerik:StyleManager.Theme="{StaticResource Theme}"
                                               ItemTemplate="{StaticResource LogicalOperatorTemplate}"
                                               ItemsSource="{Binding LogicalOperators}"
                                               SelectedItem="{Binding FieldFilterLogicalOperator, Mode=TwoWay}" />
                            <input:RadComboBox x:Name="PART_Filter2ComboBox"
                                               Margin="0,2"
                                               telerik:StyleManager.Theme="{StaticResource Theme}"
                                               ItemTemplate="{StaticResource ActionTemplate}"
                                               ItemsSource="{Binding AvailableActions}"
                                               SelectedItem="{Binding Filter2.Operator, Mode=TwoWay}" />
                            <TextBox x:Name="PART_Filter2TextBox"
                                     Text="{Binding Filter2.Value, Mode=TwoWay}"
                                     VerticalContentAlignment="Center"
                                     Margin="0,2" Padding="3,0"
                                     telerik:StyleManager.Theme="{StaticResource Theme}"
                                     Height="22" />
                            <CheckBox x:Name="PART_Filter2MatchCaseCheckBox"
                                      IsChecked="{Binding Filter2.IsCaseSensitive, Mode=TwoWay}"
                                      Visibility="{Binding MatchCaseVisibility}"
                                      Margin="0,2"
                                      telerik:LocalizationManager.ResourceKey="GridViewFilterMatchCase"
                                      telerik:StyleManager.Theme="{StaticResource Theme}"/>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Button x:Name="PART_ApplyFilterButton" Grid.Column="0"
                                    Margin="0,2,2,2" Height="22"
                                    telerik:LocalizationManager.ResourceKey="GridViewFilter"
                                    telerik:StyleManager.Theme="{StaticResource Theme}" />
                            <Button x:Name="PART_ClearFilterButton" Grid.Column="1"
                                    Margin="2,2,0,2" Height="22"
                                    telerik:LocalizationManager.ResourceKey="GridViewClearFilter"
                                    telerik:StyleManager.Theme="{StaticResource Theme}" />
                        </Grid>
                    </StackPanel>
                </Border>
            </Border>
     
        </ControlTemplate>
     
        <Style TargetType="grid:FilteringControl"  >
            <Setter Property="Template" Value="{StaticResource FilteringControlTemplate}" />
             
            <Setter Property="Background" Value="{StaticResource GridView_FilteringControlBackground}" />
            <Setter Property="BorderBrush" Value="{StaticResource GridView_FilteringControlOuterBorder}" />
            <Setter Property="Padding" Value="5" />
            <Setter Property="Margin" Value="0,2,0,0" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
             
        </Style>
     
         
         
    </ResourceDictionary>

    I hope this helps.

    Regards,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner