Declined
Last Updated: 12 Jun 2013 23:26 by ADMIN
Aaron
Created on: 20 Sep 2012 21:47
Category: Kendo UI for jQuery
Type: Feature Request
1
Reflection code in newest Kendo version can break with data model subclassing.
Our data model classes look kind of like this:

public abstract class VMBaseDynamic<TViewModel, TModel> {
public object Id { get; set; }
}

public abstract class VMBaseGeneric<TViewModel, TModel, TIdentifier> : VMBaseDynamic<TViewModel, TModel>
{
public new virtual TIdentifier Id {...}
}

So anything that subclasses from them has two Id properties, the one in VMBaseDynamic hidden in VMBaseGeneric.

The reflection code in the newest Kendo code, in GridEditableSettings.CreateDefaultItem, calls GetProperty() on the data model class for each of the column names.  One of them is "Id".  It finds two, and chokes with an "ambiguous match found" error.  I ended up working around this by adding a function which searches through the class's ancestors for the first matching property, as in http://stackoverflow.com/questions/994698/ambiguousmatchexception-type-getproperty-c-sharp-reflection; you may want to consider this as a friendlier approach in future.
1 comment
ADMIN
Brandon
Posted on: 12 Jun 2013 23:26
Could you please open a support ticket and send us a sample project?