Load on Demand with Web API breaks with CamelCasePropertyNamesContractResolver

2 posts, 0 answers
  1. terrysmith
    terrysmith avatar
    131 posts
    Member since:
    Nov 2006

    Posted 14 Mar 2017 Link to this post

    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

  2. terrysmith
    terrysmith avatar
    131 posts
    Member since:
    Nov 2006

    Posted 14 Mar 2017 in reply to terrysmith Link to this post

    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!

     

Back to Top