Search as you Type example

6 posts, 0 answers
  1. Byron
    Byron avatar
    19 posts
    Member since:
    Jan 2009

    Posted 27 Mar 2009 Link to this post

    FYI,,,,The "Search as you Type" Filtering sample on your website is missing its source code. When you click on View Code you get "Cannot find description" and a blank page.

    Also, the version that comes with the downloads "Launch the C# Examples" seems to have some problems with the source code.

    I've tried to implement a test version of this filter and as I step through the code it seems all my code does is instantiate the CustomFilterDescription class and that's it. I've basically implemented it just like the sample code. I don't see where method SatisfiesFilter() gets called.....from either of the .cs files in the sample code.  

    Am I not understanding this sample or is there a complete/updated set of source for the sample I could obtain? We're in the process of trying to get a couple license purchases authorized and I'm building a proof of concept form with the trial version and it would be really nice if I could implement this functionality in the proof of concept.

  2. Stefan Dobrev
    Stefan Dobrev avatar
    790 posts

    Posted 30 Mar 2009 Link to this post

    Hello Byron,

    Let me address your problems in order.

    We have fixed the problems with the online viewer of the source code. Everything is fine on this page.

    I have tried the offline viewer of the examples and everything works fine on my end. I can browse the examples and look at the source code. Can you share your specific problems with it?

    SatisfiesFilter() method gets called when you set the FilterDescription property of the grid to your CustomFilterDescription instance. I have prepared an example solution that illustrates how to implement custom filtering. You can find it as an attachment to this post.

    Hope this helps.

    All the best,
    Stefan Dobrev
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. Byron
    Byron avatar
    19 posts
    Member since:
    Jan 2009

    Posted 02 Apr 2009 Link to this post

    Sorry for the delay, I attempted to download your sample zip file but when I go to unzip it I get an error in the log it shows as an unsupported compression method 9.  Are you using WinZip? If so, which version?

  4. Byron
    Byron avatar
    19 posts
    Member since:
    Jan 2009

    Posted 03 Apr 2009 Link to this post

    Nevermind,,,,,figured it out,,,,,operator error.
  5. Anna Katrina
    Anna Katrina avatar
    9 posts
    Member since:
    Feb 2013

    Posted 17 Jun 2015 Link to this post


     I was able to do implement search as you type by using this demo as referenced.. 



    However, one of my column has listbox control inside.. When im trying to search for an item that exists inside the listbox, no data is being shown, I believe my Search feature is only limited on searching what it can see on the column but not items inside a control in the column.. Is there any way I can implement searching items in my listbox as well?

     I have attached an image of how my application looks like.. Also here is my source code.

            <DataTemplate x:Key="CompanyGroupsItemTemplate">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/AssociationManagementTool;component/Resources/Icons/Bullet.png" Width="5" Height="5" Margin="0,0,4,0" />
                        <TextBlock Text="{Binding GroupName}"  MouseLeftButtonUp="txtGroupName_MouseLeftButtonUp" Cursor="Hand" Width="Auto" />
            <DataTemplate x:Key="CompanyGroupList">
                    <ListBox BorderThickness="0" ItemsSource="{Binding CompanyGroups}" ItemTemplate="{StaticResource CompanyGroupsItemTemplate}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" />

    <telerik:RadGridView x:Name="gvCompanyList" MinHeight="343" Margin="0,0,0,5"
                                        IsReadOnly="True" CanUserReorderColumns="True"
                                        EnableRowVirtualization="True" AutoGenerateColumns="False" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="True" 
                                        SelectionMode="Extended" SelectionUnit="Cell"
                                        AMT_Utilities:CustomFilterBehavior.TextBox="{Binding ElementName=txtSearchCompany}">
                                    <telerik:GridViewDataColumn Header="CompanyID" Width="Auto" DataMemberBinding="{Binding CompanyID}" ShowDistinctFilters="True" IsVisible="False"/>
                                    <telerik:GridViewColumn Width="Auto" >
                                            <Border Padding="5,0,5,0" BorderThickness="0">
                                                <CheckBox x:Name="chkAllCompany" HorizontalAlignment="Center" VerticalAlignment="Center" Click="chkAllCompany_Click" />
                                            <Style TargetType="telerik:GridViewCell">
                                                <Setter Property="Template">
                                                        <ControlTemplate TargetType="telerik:GridViewCell">
                                                            <Border Padding="5,0,5,0" BorderThickness="0,0,1,1" BorderBrush="#FFB3B3B3">
                                                                <CheckBox x:Name="chkCompany" IsChecked="{Binding IsSelected, Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Center" Click="chkCompany_Click" />
                                    <telerik:GridViewDataColumn Header="Company" Width="*" DataMemberBinding="{Binding CompanyName}" ShowDistinctFilters="True" />
                                    <telerik:GridViewDataColumn Header="Company Type" Width="*" DataMemberBinding="{Binding CompanyType}" ShowDistinctFilters="True" />
                                    <telerik:GridViewDataColumn Header="Market" Width="*" DataMemberBinding="{Binding Market}" ShowDistinctFilters="True" />
                                    <telerik:GridViewDataColumn Header="Affiliation" Width="*" DataMemberBinding="{Binding Affiliation}" ShowDistinctFilters="True"/>
                                    <telerik:GridViewDataColumn Header="Delivery Method" Width="*" DataMemberBinding="{Binding DeliveryMethod}" ShowDistinctFilters="True"/>
                                    <telerik:GridViewDataColumn Header="Country/Territory" Width="*" DataMemberBinding="{Binding CountryName}" ShowDistinctFilters="True" />
                                    <telerik:GridViewDataColumn UniqueName="colCompanyGroup" Header="Grouped In"  Width="*" CellTemplate="{StaticResource CompanyGroupList}" DataMemberBinding="{Binding CompanyGroupName}" />


    Please kindly help. Thanks!

  6. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 18 Jun 2015 Link to this post


    Filtering is a data operation and it is always performed on actual underlying data (based on the specified DataMemberBinding or FilterMemberPath). Internally, it is done by building and executing a LINQ query appending proper Where clause over the source collection. 

    For your case, you can refer to the blog on Filtering Collection Properties with RadGridView for Silverlight and WPF.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top