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

Load on Demand with Web API breaks with CamelCasePropertyNamesContractResolver

1 Answer 36 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
terrysmith
Top achievements
Rank 1
terrysmith asked on 14 Mar 2017, 08:43 PM

I've had Load on Demand working with the RadComboBox for a long time with a TelerikController Web API resource. While building-out more of our API I recently made all JSON responses camel case like so:

Dim settings As JsonSerializerSettings = GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings
settings.Formatting = Formatting.Indented
settings.ContractResolver = New CamelCasePropertyNamesContractResolver()

 

The camel casing breaks RadComboBox though. Items returned from the web service will not be displayed in the dropdown. Is there any property that can be set to change this behavior or do we have to give up camel casing? I don't want to manually handle the response event and parse the JSON.

Thank you

1 Answer, 1 is accepted

Sort by
0
terrysmith
Top achievements
Rank 1
answered on 14 Mar 2017, 09:39 PM

Nevermind... I left the global config to camel case and instead of adding a CamelCaseControllerAttribute (examples all over the web forums) I added a PascalCaseControllerAttribute for our Telerik controller. Works great!

 

Tags
ComboBox
Asked by
terrysmith
Top achievements
Rank 1
Answers by
terrysmith
Top achievements
Rank 1
Share this question
or