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

Radgrid filtering not working with endswith

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anup
Top achievements
Rank 1
Anup asked on 04 Apr 2016, 09:33 AM

I have used telerik radgrid in my application. I have data in the form of queryable collection. I have enablelinqexpression set to true.

So when i use endswith filter i get an expression in the form of : (iif(User == null, "", User).ToString().ToUpper().EndsWith("system".ToUpper()))

Where user is the column name and system is the string that needs to be searched for.

I am passing the filter expression to the where condition of my collection as shown : filteredItems.Where(filterExpression);

My filteredItems collection already have records and also those records that endswith system.

But it still returns zero count or records.

 

The filter expression is working in case of startswith, is not null, is null. But not working for few of the filters like endswith, contains etc.

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 07 Apr 2016, 07:20 AM
Hi Anup,

Please make sure that you are not using DataBind() to bind the grid. Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Exporting, Paging, Sorting, Filtering, etc. require accommodating appropriate database operations.  Therefore, we suggest you to avoid Simple Databinding and strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
Declarative DataSource
Programmatic Data Binding
(NeedDataSource event)


In this sense, you should leave the filtering to the grid. You can also check the third web site from this post:
http://www.telerik.com/forums/how-to-persist-dropdownlist-selected-index-and-value-on-postback-from-radgrid-filtertemplate#GW3MyQLmVEmy8XzsmrHzeQ


Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Anup
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or