var type = typeof(T);
                var property = type.GetProperty(columnSelectName);
                var parameter = Expression.Parameter(type, "p");
                var propertyAccess = Expression.MakeMemberAccess(parameter, property);
                var orderByExp = Expression.Lambda(propertyAccess, parameter);

                if (dataGridView.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection != SortOrder.Ascending)
                {
                    MethodCallExpression resultExp = Expression.Call(typeof(Queryable), "OrderBy", new Type[] { type, property.PropertyType }, data.Expression, Expression.Quote(orderByExp));

                    bindingSource.DataSource = data.Provider.CreateQuery<T>(resultExp);

                    dataGridView.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = SortOrder.Ascending;
                }

Sortuje dane tak i jest ok ale kiedy kliknę w kolumnę z klasy poniżej to jest błąd:

Określony element członkowski typu („TypeName”) nie jest obsługiwany w składniku LINQ to Entities. Obsługiwane są tylko inicjatory, elementy członkowskie jednostki i właściwości nawigacji jednostki.

Da się zrobić inaczej i się sortuje ale muszę wtedy robić ToList() i później jak dodam dane do bindingsoruce to się nie zapisują w bazie.

W Linq To SQL sortowanie działa automatycznie.

    public partial class Logs
    {
        public string UserName
        {
            get
            {
                if (this.id_user.HasValue)
                    return this.Users.login;
                else
                    return string.Empty;
            }
        }
        
        public string TypeName
        {
            get
            {
                TypeLogs typeLogs = (TypeLogs)this.type;

                switch (typeLogs)
                {
                    case TypeLogs.LogOn:
                        return "Logowanie";
                    case TypeLogs.LogOff:
                        return "Wylogowanie";
                    case TypeLogs.LogOnFailed:
                        return "Nieudane logowanie";
                    case TypeLogs.LogsDelete:
                        return "Usunięto logi";
                    default:
                        return string.Empty;
                }
            }
        }