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

Filtering grid with datatable as datasource

2 Answers 271 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vittorio
Top achievements
Rank 1
Vittorio asked on 05 Mar 2014, 02:55 PM
Hi everyone! I'm trying to create a Grid that uses a datatable as datasource; i have defined a wcf service whose GetDataAndCount method returns datasource from a datatable when the page is loaded; now, i would like to define within this method the logic that determines which data must be returned when columns of the grid are filtered; my idea is to make filter on datatable within GetDataAndCount method, the question is how can i read from this method the filter applied to each column (and then use it to filter data in datatable)?

Regards, thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 10 Mar 2014, 09:28 AM
Hi Vittorio,

If you intend to use the built-in filter functionality there is no need to implement additional logic to filter the datasource as this is automatically done when you enable filter feature. All you have to do is set AllowFilteringByColumn property to true. You could check out the following live example which demonstrates that.

Regards,
Kostadin
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
Vittorio
Top achievements
Rank 1
answered on 11 Mar 2014, 09:09 AM
Thank you Kostadin! iI actually already solved this problem soon after I wrote this post; i was looking for  the parameter "FilterExpression" input to the method "GetdataandCount" defined in wcf that deals with databinding.

Regards.
Tags
Grid
Asked by
Vittorio
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Vittorio
Top achievements
Rank 1
Share this question
or