Hi, i'm trying to get sorting working using dynamic data but it's throwing errors, when I try to sort I get the error
No property or field 'Forenames' exists in type 'Object'
[ParseException: No property or field 'Forenames' exists in type 'Object'] Telerik.Web.UI.ExpressionParser.ParseMemberAccess(Type type, Expression instance) +922 Telerik.Web.UI.ExpressionParser.ParseIdentifier() +382 Telerik.Web.UI.ExpressionParser.ParsePrimaryStart() +31 Telerik.Web.UI.ExpressionParser.ParsePrimary() +14 Telerik.Web.UI.ExpressionParser.ParseUnary() +262
Is it possible with dynamic data to sort?
No property or field 'Forenames' exists in type 'Object'
[ParseException: No property or field 'Forenames' exists in type 'Object'] Telerik.Web.UI.ExpressionParser.ParseMemberAccess(Type type, Expression instance) +922 Telerik.Web.UI.ExpressionParser.ParseIdentifier() +382 Telerik.Web.UI.ExpressionParser.ParsePrimaryStart() +31 Telerik.Web.UI.ExpressionParser.ParsePrimary() +14 Telerik.Web.UI.ExpressionParser.ParseUnary() +262
Is it possible with dynamic data to sort?
protected void ResultsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e){..................... List<dynamic> contacts = new List<dynamic>(); foreach (Entity result in results.Entities) { Contact contact = result.ToEntity<Contact>(); contacts.Add( new { Id = contact.Id, Forenames = contact.FirstName, Surname = contact.FirstName, ReferenceNumber = contact.mps_ReferenceNumber, AddressLine1 = contact.Address1_Line1, AddressPostalCode = contact.Address1_PostalCode, AddressCountry = (contact.mps_address1_country == null) ? "" : contact.mps_address1_country.Name } ); } ResultsGrid.DataSource = contacts;}