This is an interesting example. I have been working with it to see if I can get the grid wroking with my dynamic objects.
Unfortunately, unless I'm missing something, your example is really just casting a list of non dynamic objects to a list of dynamic objects. The underlying type remains non-dynamic and the example works. However, if I create actual dynamic objects and try to get them to the grid via ajax, the data does not display.
For example, if you build the list like this:
var dataList = new List<
dynamic row = new System.Dynamic.ExpandoObject();
row.StringValue = "FirstString";
row.IntValue = 1;
row = new System.Dynamic.ExpandoObject();
row.StringValue = "SecondString";
row.IntValue = 2;
This gies you a list of dynamic objects, but the grid does not display the values even though it does recognize that there are rows in the datasource.
I have successfully displayed dynamic data like this on the KendoUI Grid, but only by passing it in as the model data. The part that doesn't work (as far as I can tell) is when I try to use Ajax, which involves serializing and deserializing the data. I realize that the ExpandoObject is not serializable, so in my project I created a serializable dynamic object and tried to use that, but it didn't solve the problem. the data still does not display. It seems that the json data is not deserialized in a way that the grid can use it, even if I specify the fields of the model using .Model().
I need to use a datasource with Ajax because some of the grids that I will display could have thousands of lines, which will cause a performance problem if is all loaded into the browser.