How to use the CamelCase formatting for a column

2 posts, 0 answers
  1. Semenov
    Semenov avatar
    1 posts
    Member since:
    Jun 2016

    Posted 18 Sep 2017 Link to this post

    I have a data on a server with the CalbelCase formatting for properties. How bind column to model via lambda expression?

    This example demonstrates this:

        .Columns(columns => {
            columns.Bound(m => m.Name);
            columns.Bound(m => m.Price);
        .DataSource(d => d
            .Model(model => {
                model.Id(m => m.Key);
                model.Field(m => m.Name);
            .Read(read => read.Action("Get", "Contacts"))

    My JSON form WebApi controller:

    {"data":[{"name":"Test Name","price":100,"key":0},{"name":"Test Name 2","price":1,"key":1}],"total":2,"aggregateResults":null,"errors":null}

  2. Stefan
    Stefan avatar
    1595 posts

    Posted 21 Sep 2017 Link to this post

    Hello, Semenov,

    In this scenario, if the model or the field names cannot be changed I can suggest using custom dataSource and its schema.parse function to parse the response:

    .Schema(schema => schema
        .Parse(@<text>function (data) {
            // configure a parse function only if the response (data) must be
            // transformed in some way before data binding
            return data;

    I hope this is helpful.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top