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

How to make Contains Filter use Full Text Index Search?

2 Answers 244 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 17 Dec 2009, 06:05 PM
How do I make RadGrid's contains filter to use SQL Server's contains(fieldname, 'searchvalue') instead of %searchvalue%?

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Dec 2009, 06:19 AM
Hi,

You can customise the filter expression for the Contains filter as shown in the help document links below. You need to check for the Filter Command in the Itemcommand event and then reset tehe filter expression to use the Full text index search.

Operating with the FilterExpression of Telerik RadGrid manually

Custom option for filtering (FilterListOptions -> VaryByDataTypeAllowCustom)

Here is  a lhelpful link on Full Text Index Search feature of Sql Server

http://www.developer.com/db/article.php/3446891/Understanding-SQL-Server-Full-Text-Indexing.htm


Thanks,
Princy
0
Lenny_shp
Top achievements
Rank 2
answered on 18 Dec 2009, 03:31 PM
The approach is to change declarative datasource to NeedDataSource method and check for specific column's name to apply FullTextSearch filter?     Thanks.



http://www.telerik.com/help/aspnet-ajax/grdfilteringfordatetimecolumnwithdataformatstring.html

case "Contains":
                   filterPattern = "CONTAINS([SomeTextField],'" + filterPattern + "')";
                   dateColumn.CurrentFilterFunction = GridKnownFunction.Contains;


  foreach (GridColumn column in RadGrid1.MasterTableView.Columns)
  {
    if (column.UniqueName != "OrderDate")
    {
      column.CurrentFilterFunction = GridKnownFunction.NoFilter;
      column.CurrentFilterValue = string.Empty;
    }
  }
Tags
Grid
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Lenny_shp
Top achievements
Rank 2
Share this question
or