WCF OData Clientside binding with filter from dropdown

10 posts, 0 answers
  1. Marcel
    Marcel avatar
    21 posts
    Member since:
    Feb 2007

    Posted 06 Sep 2011 Link to this post

    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

  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts
    Member since:
    Sep 2012

    Posted 09 Sep 2011 Link to this post

    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 >>

  3. DevCraft Release
  4. Marcel
    Marcel avatar
    21 posts
    Member since:
    Feb 2007

    Posted 13 Sep 2011 Link to this post

    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.

  5. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts
    Member since:
    Sep 2012

    Posted 15 Sep 2011 Link to this post

    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

  6. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts
    Member since:
    Sep 2012

    Posted 21 Sep 2011 Link to this post

    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

  7. Ronak
    Ronak avatar
    108 posts
    Member since:
    Sep 2010

    Posted 21 Feb 2012 Link to this post

    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

  8. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts
    Member since:
    Sep 2012

    Posted 24 Feb 2012 Link to this post

    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.

  9. Ronak
    Ronak avatar
    108 posts
    Member since:
    Sep 2010

    Posted 24 Feb 2012 Link to this post

    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

  10. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts
    Member since:
    Sep 2012

    Posted 29 Feb 2012 Link to this post

    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.

  11. Ronak
    Ronak avatar
    108 posts
    Member since:
    Sep 2010

    Posted 29 Feb 2012 Link to this post

    Thanks for you reply

Back to Top
DevCraft Release