-
Notifications
You must be signed in to change notification settings - Fork 459
Description
🙋 Feature Request
GridSort assumes the sorting is only possible on columns where the column expression is a MemberExpression to be able to apply it to an IQueryable.
This means that any model used with an ItemsProvider must provider a Member for any sortable property, and that it must somehow map those member names to a sorting method.
💁 Possible Solution
I see 2 possible solutions for this:
a. Add GridSort constructor that allows a arbitrary key to be used as PropertyName, so that SortedProperty.PropertyName can be mapped to the custom sorting logic.
b. Add an optional ColumnKey to each column and allow GridSort to use null for PropertyName, but add the ColumnKey in SortedProperty.
🔦 Context
Have a complex code base where the underlying db model does not support IQueryable and columns are very dynamic.
💻 Examples
<FluentDataGrid ItemsProvider="@ItemsProvider" >
@foreach (var colDef in UserColumns) {
<PropertyColumn Title="@colDef.CustomUserPropertyName" Property="@(x => colDef.GetValueFor(x))" Sortable="true" SortBy="NotPossible" />
}
</FluentDataGrid>