FlexGrid with ODataCollectionView Adds Spaces To Column Names

Posted by: paulr on 5 March 2021, 4:56 pm EST

    • Post Options:
    • Link

    Posted 5 March 2021, 4:56 pm EST - Updated 3 October 2022, 2:20 pm EST

    Hi,

    I have a FlexGrid with ODataCollectionView and the data sent to the client carries columns without spaces such as “ProjectShortName” and “ProjectName”:

    Sample partial OData response:

    
    {"@odata.context":"$metadata#Project","@odata.count":4,"value":[{"ProjectShortName":"Test Project Short Name","ProjectName":"Test Project Name"...
    
    

    I noticed that Wijmo automatically adds spaces between the capital letters when displaying column headers like so:

    It works fine for my purposes. My question is - where is the code which converts names and adds the spaces? I would like to reuse that same code or same logic for another purpose in my application.

    Thank you,

    Paul

  • Posted 7 March 2021, 11:51 pm EST

    Hi Paul,

    You can use the toHeaderCase method of Wijmo for this:

    https://www.grapecity.com/wijmo/api/index.html#toheadercase

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels