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

Advanced Databinding with WebMethod

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 04 Aug 2010, 09:35 PM
I have looked through many articles and examples, but I cannot find something that will work with what I am trying to accomplish.

We do not use the grid's filtering capability. Rather, we have a panel that has all filtering necessary with the buttons to apply and clear the filter. We are also using advanced databinding (NeedDataSource event) with stored procedures. I would like to use data binding with web services, but the problem that we have converting to this model is the filter expressions. Any suggestions? Questions?

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 10 Aug 2010, 01:43 PM
Hello Ron,

For more information about operating with filter expressions, please refer to the help article below:
Operating with the FilterExpression of Telerik RadGrid manually

Give it a try and let me know how it goes.

Best wishes,
Maria Ilieva
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
Ron
Top achievements
Rank 1
answered on 10 Aug 2010, 02:07 PM
Thanks for the article. I am already doing bullet point #2 in the article. I am looking to use client binding to a web service. So, I know how to customize the FilterExpression, I know how to apply the filters during the NeedDataSource event, but what I don't know is how to customize the filterExpression parameter to a WebMethod on the code-behind. For instance, if I have a grid on the page, RadGrid1, that is using client binding to the following WebMethod

[WebMethod]
public static Dictionary<string, object> GetDataAndCount( int startIndex, int maximumRows, string sortExpression, List<GridFilterExpression> filterExpression )
{
    Dictionary<string, object> returnData = new Dictionary<string, object>();
    List<InvoiceViewable> data = new List<InvoiceViewable>();
 
    // Get the data...
 
    returnData.Add( "Data", data );
    returnData.Add( "Count", data.Count );
    return ( returnData );
}
 How would I "intercept" the filterExpression that is sent to this WebMethod? Since it is a WebMethod, I would not think that I have access to my custom filter controls on the page. Suggestions?
0
Maria Ilieva
Telerik team
answered on 13 Aug 2010, 11:37 AM
Hi Ron,

Note that with the client binding you are calling a Web Sevice on the client which returns a specific serialized data. In this scenario the code will not hit the server at all as this is the main idea of the Client binding functionality.


Best wishes,
Maria Ilieva
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
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Ron
Top achievements
Rank 1
Share this question
or