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

WCF OData Clientside binding with filter from dropdown

9 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 06 Sep 2011, 01:59 PM
Hi,
Can you help me with an example of setting a filter on a oData Clientside binded RadGrid.
For example:
I want to filter my Table Patients on Surname contains 'Jan'


Hope you can help me.
Greetings
Marcel de Groot

9 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 09 Sep 2011, 07:46 AM
Hello Marcel,

Your requirement is demonstrated in the following online example:
http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx

Hope it helps.

Regards,
Tsvetoslav
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Marcel
Top achievements
Rank 1
answered on 13 Sep 2011, 02:50 PM
Thanks for you answer, but not what i expected.
The only example i see is:
<ClientSettings><BR> <DataBinding
ResponseType="JSONP"><BR> <DataService TableName="Products" Type="OData"
/><BR> </DataBinding><BR> </ClientSettings><BR>

but what i really want is something like this:
<ClientSettings><BR> <DataBinding
ResponseType="JSONP"><BR> <DataService
TableName="Products<STRONG>?$filter=substringof('Alfreds', CompanyName) eq true" Type="OData" /><BR> </DataBinding><BR>
</ClientSettings><BR>

So i only get companynames containing Alfreds.

Hope you can help me.

0
Tsvetoslav
Telerik team
answered on 15 Sep 2011, 11:27 AM
Hello Marcel,

Filter operators are not supported as yet by RadGrid's binding to OData service. I will forward this as a feature suggestion to our development team.


Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0
Tsvetoslav
Telerik team
answered on 21 Sep 2011, 10:39 AM
Hello Marcel,

I am glad to inform you that the feature we were discussing has already been implemented into RadGrid's OData binding. Now it sports a FilterQueryOption and a SortQueryOption property where you can add your filter and sort condtions. NB: the $filter= and $orderby= operators along with the equal sign should not be included in the values for those two properties.

The improvement should be available in the next latest internal build of the controls that should come out by the end of the week or in the beginning of the next one.

Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Ronak
Top achievements
Rank 1
answered on 21 Feb 2012, 04:24 PM
Thanks Telerik team
i would like achive same thing like bind combobox to one entity and once user select value it will bind grid and Telerik odata binding support Filter can you please point me to direction mean some examples i am not able to find on telerik sites.

Thanks
Ronak
0
Tsvetoslav
Telerik team
answered on 24 Feb 2012, 08:20 AM
Hello Ronak,

In order to accomplish this requirement, just set the AutoPostBack property of the combo box to true and attach an event handler to its SelectedIndexChanged event. In the event handler on the server, get hold of the newly-selected item and build your filter query as per your scenario. Then assign it to the grid's FilterQueryOption setting. Upon the page being rendered the grid will trigger a web service request to the OData service now with the new filter query option in its settings and get the filtered data.

Hope it helps.


Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ronak
Top achievements
Rank 1
answered on 24 Feb 2012, 04:06 PM
Thanks Tsvetoslav for your reply i know that but i can not write any Server side code here as we can not access service my development box i know its strange so please advise me if i can achieve through client side.As you know for Odata we do not have to write any Server side code so i would like to get it done through Odata.

Thanks
Ronak
0
Tsvetoslav
Telerik team
answered on 29 Feb 2012, 02:18 PM
Hello Marcel,

If you need to do it on the client, just use the $find('<%=YouGridID.ClientID').ClientSettings.DataBinding.DataService.FilterQueryOption to set the query option. If you are using RadComboBox, this should be done in the SelectedIndexChanged client-side event of the combo.


Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ronak
Top achievements
Rank 1
answered on 29 Feb 2012, 07:10 PM
Thanks for you reply
Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Marcel
Top achievements
Rank 1
Ronak
Top achievements
Rank 1
Share this question
or