is "parent" a reserved word in Grid?

2 posts, 0 answers
  1. Wyatt
    Wyatt avatar
    22 posts
    Member since:
    Aug 2012

    Posted 10 Jun 2016 Link to this post

    I have a very basic grid that I built with the telerik mvc grid scaffolding.


    I have a column called "parent"  that parent should display a 10 digit number, instead it displays "function (){return o}"


    I have tried templating, toString and it shows the same thing.  every other column works as expected



          .Columns(columns =>
              columns.Bound(c => c.customer_name);
              columns.Bound(c => c.reason);
              columns.Bound(c => c.parent);
          .Sortable(sortable =>
          .DataSource(dataSource => dataSource
              .Read(read => read.Action("act_trans_worktable_Read", "mvcgrid"))

  2. Marin
    Marin avatar
    1057 posts

    Posted 13 Jun 2016 Link to this post


    Yes, the "parent" keyword is used internally by the observable kendo model of the grid. That's why it is not recommended to have a "parent" field in the model's data.
    Using a kendo widget allows you to define an alias for this field and use this instead, which can resolve the problem:
        dataSource: {
            data: products,
                schema: {
                    model: {
                        fields: {
                            foo: {type: "string", from: "parent"},
                                ProductName: { type: "string"
                            columns: [
                                { field: "foo", title: "parent"},

    The MVC wrapper however does not provide such option at moment. So the best option there would be to change the column name. For example: "Parent" with capital "P" will work as expected.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top