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

Customizing FilterExpression in Simple Data Binding Grid

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aayam
Top achievements
Rank 1
Aayam asked on 15 Apr 2010, 05:50 AM
Hi Experts,

I am using Simple DataBinding for my Grid with Viewstate enabled.There is altogether a different layer with function having fixed parameter set and provide with the custom business object collection to be bind to the Grid.

Limitations:
1) Every other functionality need is working fine with Simple Data Binding of Grid.
2) Specific parameter only to Database layer to retreive Bussiness Object collection.No modification can be made.

Scenario:
New Column introduced in Grid which takes concatenated data from two different properties in Custom Bussiness object the displays it.Hence if we give datafield name as one Property the filtering would be applicable to data from that property only.But we need the filtering to work both the  properties that act as datasource to this column.

Approach:
Customize the filter in ItemCommand event for this column.

Issues:
1) Customized the filter, set it to Grid.MasterTableView FilterExpression and called ReBind() on Grid.MasterTableView, but still not working.
2) Customized the filter, set it to Grid.MasterTableView FilterExpression and explicitly bind the grid by provided it again with datasource.Hence set the DataSource again with fixed Bussiness Object Collection and called DataBind() explicitly.

I can definetly try for Advance Binding but i want to avoid  that for now because would have to modify whole page to support other functionalities related to application itself.

Both of them are not working.
Any idea would be greatly appreciated.

Regards,
Aayam Singh

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 20 Apr 2010, 10:16 AM
Hello Aayam,

The filtering feature of RadGrid is not supported with simple binding and DataBind() calls. This is outlined in the Description section of the following online demo of the product:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/GeneralFeatures/Filtering/DefaultCS.aspx

If you would like to take advantage of this grid feature, you will need to switch to advanced binding using NeedDataSource event handling or a data source control (as shown in the example linked above).

Additionally, to see how to construct the filter expression for the control, please refer to the following help article:
http://www.telerik.com/help/aspnet-ajax/grdoperatewithfilterexpression.html

Greetings,
Pavlina
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.
0
Aayam
Top achievements
Rank 1
answered on 27 Apr 2010, 06:25 AM
Hi Pavlina,
We managed to resolve this issue with your help and changes.
Thanks again for your time.

Regards,
Aayam Singh
Tags
Grid
Asked by
Aayam
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Aayam
Top achievements
Rank 1
Share this question
or