Project include a WcfService and the method GetDataAndCount of this WcfService is called for databinding by .aspx page with:
<DataBinding Location="TelerikWcfService.svc" SelectMethod="GetDataAndCount" SortParameterType="Linq" FilterParameterType="Linq"/>
I think I've correctly set up the web config with svc service data bindings.
Unfortunately, it doesn't work: on pageload, response is always 415 (Unsupported media type).
Any suggestions to solve the problem?
Thanks in advance
Regards
Vittorio
17 Answers, 1 is accepted
It would be hard to determine the exact reason that is causing the error. You need to ensure that the service returns JSON in order for the RadGrid to be bound properly. If you would like you could also take a look at this online demo where using client-side binding with web service is illustrated.
If the error is still observed would you share your markup with the code-behind and the web service code? This would enable us to try replicating the issue locally and look for a solution.
Regards,
Viktor Tachev
Telerik

JSON is not used in this project and I already took a look at this demo but it wasn't very usefull.
I have attached crucial points of the code of my website; the problem is that the code-behind of the service is never reached…I would be very grateful to you if you tried to replicate the issue to understand this behavior (if you prefer i could send to your email address the folder containing all the files and also the solution file).
Regards, thanks in advance
In order for the RadGrid to be bound on the client the data source needs to have a valid JSON signature. Please ensure that the data returned by the WebService is in JSON format. If you would like more information on client-side data binding it is available in this article.
This being said, I would appreciate if you could open a formal support and attach a runnable project where the issue is observed. This would allow us to investigate the problem locally and provide an appropriate solution.
Regards,
Viktor Tachev
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.

The problem that I've been talking about has been resolved; i did not define a wcf WITH AJAX SUPPORT to make databinding; now it works but my project is not still complete, i've another question for you.
I use this wcf also to implement checklist filtering on columns of the grid; i'd like to define just a single FilterCheckListWebServiceMethod for all the columns of the Radgrid and return a different list based on the name of the column from which that method has been called.
Is it possible? How can i pass the name of the column to this method? (the parameter Dictionary<string, object> context received by this method is empty).

Thank you in advance.
Regards.
When using checklist filtering you need to specify FilterCheckListWebServiceMethod for every column that would use such filtering. Also the CheckListWebServicePath should be set for the MasterTableView. This apporach is illustrated in an online demo here (check the second RadGrid).
Regarding your other question about adding data dynamically to a WebService there is a stackoverflow article here that discusses similar scenario. Give the approaches listed there a try and see which works best for you.
Regards,
Viktor Tachev
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.

Thanks in advance.
Regards.
Thank you for writing back.
The Dictionary parameter could be used internally by the RadListBox control that is rendered in the filtering menu for RadGrid. I am afraid, however, that currently when using the approach illustrated in the online demo for checkbox filtering you need to specify separate method that populates the data for the filter in every column.
I have logged a feature request for using a single method to populate the filter items and you could view it in our feedback portal here. You could also vote for the feature in order to increase its priority.
In order to have single method that populates the data for the filters in all columns you could use the following approach. Set the FilterCheckListEnableLoadOnDemand to true for the columns in RadGrid. When this property is enabled the FilterCheckListItemsRequested event will be thrown for every column in the grid. You could use its handler to populate the data for each column. Let me know if this approach is working for you.
If you need further assistance do not hesitate to contact us again.
Regards,
Viktor Tachev
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.


Thanks in advance!
I am glad to hear that you have implemented the required functionality.
I am afraid that limiting the checklist items in the filter menu based on previous filters when using WebService would not be possible.
You could try to implement such functionality by handling the FilterCheckListItemsRequested event for RadGrid. It is thrown for every column where the FilterCheckListEnableLoadOnDemand property is set to true. In the handler you would need to manually parse the FilterExpression for the RadGrid and populate checklist items based on the currently applied filters.
Regards,
Viktor Tachev
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

I want to ask you whether, in order to create filters of type "CheckList", the use of a WCF (what i use is not a WebService, is just a WCF with Ajax support) is the only way or there are others that allow you to save the code.
Thanks in advance!

When the FilterCheckListEnableLoadOnDemand property for a column is enabled the items in the ListView could be defined manually in the OnFilterCheckListItemsRequested event handler. It is not necessary to use a WebService. Check the sample attached project that illustrates this approach.
In case you would like to apply a filter that should be applied initially you could use an approach similar to the one illustrated in this article.
Regards,
Viktor Tachev
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.


Thanks in advance.
The FilterCheckListEnableLoadOnDemand property and the OnFilterCheckListItemsRequested event are available in our latest release (2014.1.225).
You could download a trial version of the controls after you login to our site. You need to navigate to Products & Subscriptions -> Trials -> Click "Download" next to UI for ASP.NET AJAX. You would then see a list with packages available for download.
Regards,
Viktor Tachev
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.