/// <summary> /// Returns a list of distinct column values that can be used for select filters. /// </summary> /// <param name="column">The column.</param> public virtual IList <string> GetDistinctColumnValues(DataTablesColumn <TEntity, TEntityViewModel> column) { var parameterExp = ExpressionHelper.BuildParameterExpression <TEntity>(); var propertyExp = ExpressionHelper.BuildPropertyExpression(parameterExp, column.PrivatePropertyName); var stringExp = Expression.Call(propertyExp, ExpressionHelper.Object_ToString); var lambda = Expression.Lambda <Func <TEntity, string> >(stringExp, parameterExp); return(GetDistinctColumnValues(lambda)); }
/// <summary> /// Renders the table footer column. Can be overwritten to change the rendering. /// It is also possible to return a different template based on the given column. /// </summary> /// <param name="column">The column.</param> protected virtual string RenderTableFooterColumn(DataTablesColumn <TEntity, TEntityViewModel> column) { return("<th></th>"); }
/// <summary> /// Renders a table header column. Can be overwritten to change the rendering. /// It is also possible to return a different template based on the given column. /// </summary> /// <param name="column">The column.</param> protected virtual string RenderTableHeaderColumn(DataTablesColumn <TEntity, TEntityViewModel> column) { return($"<th>{column.DisplayName}</th>"); }