Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
datatables [2011/03/15 10:09]
wilco add sign-off
datatables [2011/03/15 12:14]
wilco updating ApplySort function
Line 141: Line 141:
  
                 var paramExpr = Expression.Parameter(typeof(T),​ "​val"​);​                 var paramExpr = Expression.Parameter(typeof(T),​ "​val"​);​
-                var propertyExpr = Expression.Lambda<​Func<​T,​ object>>​(Expression.Property(paramExpr,​ _properties[sortcolumn]),​ paramExpr);+                var propertyExpr = Expression.Lambda<​Func<​T,​ object>>​(Expression.Convert(Expression.Property(paramExpr,​ _properties[sortcolumn]), typeof(object)), paramExpr); 
  
                 if (string.IsNullOrEmpty(sortdir) || sortdir.Equals(ASCENDING_SORT,​ StringComparison.OrdinalIgnoreCase))                 if (string.IsNullOrEmpty(sortdir) || sortdir.Equals(ASCENDING_SORT,​ StringComparison.OrdinalIgnoreCase))